mirror of
https://github.com/davatorium/rofi.git
synced 2025-02-17 15:45:56 -05:00
Strip pango markup from workspace names when detecting I3.
Thanks I3 for this crap. Issue: #507
This commit is contained in:
parent
5a638b1fa0
commit
ee310c8470
1 changed files with 26 additions and 1 deletions
|
@ -56,6 +56,8 @@
|
||||||
#define CLIENTSTATE 10
|
#define CLIENTSTATE 10
|
||||||
#define CLIENTWINDOWTYPE 10
|
#define CLIENTWINDOWTYPE 10
|
||||||
|
|
||||||
|
#define LOG_DOMAIN "Dialogs.Window"
|
||||||
|
|
||||||
// a manageable window
|
// a manageable window
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -97,6 +99,7 @@ typedef struct
|
||||||
unsigned int title_len;
|
unsigned int title_len;
|
||||||
unsigned int role_len;
|
unsigned int role_len;
|
||||||
GRegex *window_regex;
|
GRegex *window_regex;
|
||||||
|
gboolean i3_mode;
|
||||||
} ModeModePrivateData;
|
} ModeModePrivateData;
|
||||||
|
|
||||||
winlist *cache_client = NULL;
|
winlist *cache_client = NULL;
|
||||||
|
@ -390,6 +393,16 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
|
||||||
int nwins = 0;
|
int nwins = 0;
|
||||||
xcb_window_t wins[100];
|
xcb_window_t wins[100];
|
||||||
xcb_window_t curr_win_id;
|
xcb_window_t curr_win_id;
|
||||||
|
|
||||||
|
// Check if we are in I3 mode. I3 has to be special and allow markup in it window name......
|
||||||
|
char *i3_socket_path = window_get_text_prop ( xcb_stuff_get_root_window ( xcb ), netatoms[I3_SOCKET_PATH] );
|
||||||
|
if ( i3_socket_path != NULL ){
|
||||||
|
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Detected I3 Window manager running.");
|
||||||
|
pd->i3_mode = TRUE;
|
||||||
|
g_free ( i3_socket_path );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create cache
|
// Create cache
|
||||||
|
|
||||||
x11_cache_create ();
|
x11_cache_create ();
|
||||||
|
@ -470,8 +483,20 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
|
||||||
}
|
}
|
||||||
if ( c->wmdesktop != 0xFFFFFFFF ) {
|
if ( c->wmdesktop != 0xFFFFFFFF ) {
|
||||||
if ( has_names ) {
|
if ( has_names ) {
|
||||||
|
if ( pd->i3_mode ) {
|
||||||
|
char *output = NULL;
|
||||||
|
if (pango_parse_markup ( _window_name_list_entry ( names.strings, names.strings_len,
|
||||||
|
c->wmdesktop ),-1, 0, NULL, &output, NULL, NULL)){
|
||||||
|
c->wmdesktopstr = output;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
c->wmdesktopstr = g_strdup ( "Invalid name");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
c->wmdesktopstr = g_strdup ( _window_name_list_entry ( names.strings, names.strings_len, c->wmdesktop ) );
|
c->wmdesktopstr = g_strdup ( _window_name_list_entry ( names.strings, names.strings_len, c->wmdesktop ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
c->wmdesktopstr = g_strdup_printf ( "%u", (uint32_t) c->wmdesktop );
|
c->wmdesktopstr = g_strdup_printf ( "%u", (uint32_t) c->wmdesktop );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue