29 #define G_LOG_DOMAIN "Dialogs.Window"
43 #include <xcb/xcb_atom.h>
44 #include <xcb/xcb_ewmh.h>
45 #include <xcb/xcb_icccm.h>
65 #define CLIENTSTATE 10
66 #define CLIENTWINDOWTYPE 10
75 WIN_MATCH_FIELD_TITLE,
76 WIN_MATCH_FIELD_CLASS,
79 WIN_MATCH_FIELD_DESKTOP,
81 } WinModeMatchingFields;
83 static WinModeField matching_window_fields[WIN_MATCH_NUM_FIELDS] = {
85 .field_name =
"title",
89 .field_name =
"class",
101 .field_name =
"desktop",
105 static gboolean window_matching_fields_parsed = FALSE;
110 xcb_get_window_attributes_reply_t xattr;
116 xcb_atom_t state[CLIENTSTATE];
118 xcb_atom_t window_type[CLIENTWINDOWTYPE];
124 unsigned int wmdesktopstr_len;
125 cairo_surface_t *
icon;
126 gboolean icon_checked;
127 uint32_t icon_fetch_uid;
128 gboolean thumbnail_checked;
144 unsigned int wmdn_len;
145 unsigned int clf_len;
146 unsigned int name_len;
147 unsigned int title_len;
148 unsigned int role_len;
149 GRegex *window_regex;
150 } WindowModePrivateData;
152 winlist *cache_client = NULL;
159 static winlist *winlist_new() {
160 winlist *l = g_malloc(
sizeof(winlist));
162 l->array = g_malloc_n(WINLIST + 1,
sizeof(xcb_window_t));
163 l->data = g_malloc_n(WINLIST + 1,
sizeof(client *));
176 static int winlist_append(winlist *l, xcb_window_t w, client *d) {
177 if (l->len > 0 && !(l->len % WINLIST)) {
179 g_realloc(l->array,
sizeof(xcb_window_t) * (l->len + WINLIST + 1));
180 l->data = g_realloc(l->data,
sizeof(client *) * (l->len + WINLIST + 1));
184 if (l->data == NULL || l->array == NULL) {
189 l->array[l->len++] = w;
193 static void client_free(client *c) {
198 cairo_surface_destroy(c->icon);
204 g_free(c->wmdesktopstr);
206 static void winlist_empty(winlist *l) {
208 client *c = l->data[--l->len];
221 static void winlist_free(winlist *l) {
238 static int winlist_find(winlist *l, xcb_window_t w) {
246 for (i = (l->len - 1); i >= 0; i--) {
247 if (l->array[i] == w) {
257 static void x11_cache_create(
void) {
258 if (cache_client == NULL) {
259 cache_client = winlist_new();
266 static void x11_cache_free(
void) {
267 winlist_free(cache_client);
280 static xcb_get_window_attributes_reply_t *
281 window_get_attributes(xcb_window_t w) {
282 xcb_get_window_attributes_cookie_t c =
284 xcb_get_window_attributes_reply_t *r =
292 static int client_has_state(client *c, xcb_atom_t state) {
293 for (
int i = 0; i < c->states; i++) {
294 if (c->state[i] == state) {
301 static int client_has_window_type(client *c, xcb_atom_t type) {
302 for (
int i = 0; i < c->window_types; i++) {
303 if (c->window_type[i] == type) {
311 static client *window_client(WindowModePrivateData *pd, xcb_window_t win) {
312 if (win == XCB_WINDOW_NONE) {
316 int idx = winlist_find(cache_client, win);
319 return cache_client->data[idx];
323 xcb_get_window_attributes_reply_t *attr = window_get_attributes(win);
328 client *c = g_malloc0(
sizeof(client));
332 memmove(&c->xattr, attr,
sizeof(xcb_get_window_attributes_reply_t));
334 xcb_get_property_cookie_t cky = xcb_ewmh_get_wm_state(&
xcb->
ewmh, win);
335 xcb_ewmh_get_atoms_reply_t states;
336 if (xcb_ewmh_get_wm_state_reply(&
xcb->
ewmh, cky, &states, NULL)) {
337 c->states = MIN(CLIENTSTATE, states.atoms_len);
338 memcpy(c->state, states.atoms,
339 MIN(CLIENTSTATE, states.atoms_len) *
sizeof(xcb_atom_t));
340 xcb_ewmh_get_atoms_reply_wipe(&states);
342 cky = xcb_ewmh_get_wm_window_type(&
xcb->
ewmh, win);
343 if (xcb_ewmh_get_wm_window_type_reply(&
xcb->
ewmh, cky, &states, NULL)) {
344 c->window_types = MIN(CLIENTWINDOWTYPE, states.atoms_len);
345 memcpy(c->window_type, states.atoms,
346 MIN(CLIENTWINDOWTYPE, states.atoms_len) *
sizeof(xcb_atom_t));
347 xcb_ewmh_get_atoms_reply_wipe(&states);
351 if (tmp_title == NULL) {
354 c->title = g_markup_escape_text(tmp_title, -1);
356 MAX(c->title ? g_utf8_strlen(c->title, -1) : 0, pd->title_len);
360 c->role = g_markup_escape_text(tmp_role ? tmp_role :
"", -1);
361 pd->role_len = MAX(c->role ? g_utf8_strlen(c->role, -1) : 0, pd->role_len);
365 xcb_icccm_get_wm_class_reply_t wcr;
366 if (xcb_icccm_get_wm_class_reply(
xcb->
connection, cky, &wcr, NULL)) {
367 c->class = g_markup_escape_text(wcr.class_name, -1);
368 c->name = g_markup_escape_text(wcr.instance_name, -1);
369 pd->name_len = MAX(c->name ? g_utf8_strlen(c->name, -1) : 0, pd->name_len);
370 xcb_icccm_get_wm_class_reply_wipe(&wcr);
373 xcb_get_property_cookie_t cc =
375 xcb_icccm_wm_hints_t r;
376 if (xcb_icccm_get_wm_hints_reply(
xcb->
connection, cc, &r, NULL)) {
377 c->hint_flags = r.flags;
380 winlist_append(cache_client, c->window, c);
385 guint window_reload_timeout = 0;
386 static gboolean window_client_reload(G_GNUC_UNUSED
void *data) {
387 window_reload_timeout = 0;
388 if (window_mode.private_data) {
389 window_mode._destroy(&window_mode);
390 window_mode._init(&window_mode);
392 if (window_mode_cd.private_data) {
393 window_mode._destroy(&window_mode_cd);
394 window_mode._init(&window_mode_cd);
396 if (window_mode.private_data || window_mode_cd.private_data) {
399 return G_SOURCE_REMOVE;
401 void window_client_handle_signal(xcb_window_t win, gboolean create) {
403 if (window_reload_timeout > 0) {
404 g_source_remove(window_reload_timeout);
405 window_reload_timeout = 0;
407 window_reload_timeout = g_timeout_add(100, window_client_reload, NULL);
410 unsigned int index) {
411 WindowModePrivateData *rmpd =
414 const winlist *ids = (winlist *)rmpd->ids;
416 int idx = winlist_find(cache_client, ids->array[index]);
418 client *c = cache_client->data[idx];
421 for (
int j = 0; match && tokens != NULL && tokens[j] != NULL; j++) {
428 if (c->title != NULL && c->title[0] !=
'\0' &&
429 matching_window_fields[WIN_MATCH_FIELD_TITLE].enabled) {
433 if (test == tokens[j]->invert && c->class != NULL &&
434 c->class[0] !=
'\0' &&
435 matching_window_fields[WIN_MATCH_FIELD_CLASS].enabled) {
439 if (test == tokens[j]->invert && c->role != NULL && c->role[0] !=
'\0' &&
440 matching_window_fields[WIN_MATCH_FIELD_ROLE].enabled) {
444 if (test == tokens[j]->invert && c->name != NULL && c->name[0] !=
'\0' &&
445 matching_window_fields[WIN_MATCH_FIELD_NAME].enabled) {
448 if (test == tokens[j]->invert && c->wmdesktopstr != NULL &&
449 c->wmdesktopstr[0] !=
'\0' &&
450 matching_window_fields[WIN_MATCH_FIELD_DESKTOP].enabled) {
463 static void window_mode_parse_fields() {
464 window_matching_fields_parsed = TRUE;
468 const char *
const sep =
",#";
470 for (
unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++) {
471 matching_window_fields[i].enabled = FALSE;
473 for (
char *token = strtok_r(switcher_str, sep, &savept); token != NULL;
474 token = strtok_r(NULL, sep, &savept)) {
475 if (strcmp(token,
"all") == 0) {
476 for (
unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++) {
477 matching_window_fields[i].enabled = TRUE;
481 gboolean matched = FALSE;
482 for (
unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++) {
483 const char *field_name = matching_window_fields[i].field_name;
484 if (strcmp(token, field_name) == 0) {
485 matching_window_fields[i].enabled = TRUE;
490 g_warning(
"Invalid window field name :%s", token);
494 g_free(switcher_str);
497 static unsigned int window_mode_get_num_entries(
const Mode *sw) {
498 const WindowModePrivateData *pd =
501 return pd->ids ? pd->ids->len : 0;
507 const char *invalid_desktop_name =
"n/a";
508 static const char *_window_name_list_entry(
const char *str, uint32_t length,
512 while (index < entry && offset < length) {
513 if (str[offset] == 0) {
518 if (offset >= length) {
519 return invalid_desktop_name;
523 static void _window_mode_load_data(
Mode *sw,
unsigned int cd) {
524 WindowModePrivateData *pd =
527 xcb_window_t curr_win_id;
533 xcb_get_property_cookie_t c =
535 if (!xcb_ewmh_get_active_window_reply(&
xcb->
ewmh, c, &curr_win_id, NULL)) {
540 unsigned int current_desktop = 0;
542 if (!xcb_ewmh_get_current_desktop_reply(&
xcb->
ewmh, c, ¤t_desktop,
549 xcb_ewmh_get_windows_reply_t clients = {
552 if (xcb_ewmh_get_client_list_stacking_reply(&
xcb->
ewmh, c, &clients, NULL)) {
556 if (xcb_ewmh_get_client_list_reply(&
xcb->
ewmh, c, &clients, NULL)) {
564 if (clients.windows_len > 0) {
569 pd->ids = winlist_new();
571 xcb_get_property_cookie_t prop_cookie =
573 xcb_ewmh_get_utf8_strings_reply_t names;
574 int has_names = FALSE;
575 if (xcb_ewmh_get_desktop_names_reply(&
xcb->
ewmh, prop_cookie, &names,
580 for (i = clients.windows_len - 1; i > -1; i--) {
581 client *winclient = window_client(pd, clients.windows[i]);
582 if ((winclient != NULL) && !winclient->xattr.override_redirect &&
583 !client_has_window_type(winclient,
584 xcb->
ewmh._NET_WM_WINDOW_TYPE_DOCK) &&
585 !client_has_window_type(winclient,
586 xcb->
ewmh._NET_WM_WINDOW_TYPE_DESKTOP) &&
587 !client_has_state(winclient,
xcb->
ewmh._NET_WM_STATE_SKIP_PAGER) &&
588 !client_has_state(winclient,
xcb->
ewmh._NET_WM_STATE_SKIP_TASKBAR)) {
590 MAX(pd->clf_len, (winclient->class != NULL)
591 ? (g_utf8_strlen(winclient->class, -1))
594 if (client_has_state(winclient,
595 xcb->
ewmh._NET_WM_STATE_DEMANDS_ATTENTION)) {
596 winclient->demands = TRUE;
598 if ((winclient->hint_flags & XCB_ICCCM_WM_HINT_X_URGENCY) != 0) {
599 winclient->demands = TRUE;
602 if (winclient->window == curr_win_id) {
603 winclient->active = TRUE;
606 xcb_get_property_cookie_t cookie;
607 xcb_get_property_reply_t *r;
609 winclient->wmdesktop = 0xFFFFFFFF;
610 cookie = xcb_get_property(
xcb->
connection, 0, winclient->window,
611 xcb->
ewmh._NET_WM_DESKTOP, XCB_ATOM_CARDINAL,
615 if (r->type == XCB_ATOM_CARDINAL) {
616 winclient->wmdesktop = *((uint32_t *)xcb_get_property_value(r));
620 if (winclient->wmdesktop != 0xFFFFFFFF) {
625 if (pango_parse_markup(
626 _window_name_list_entry(names.strings, names.strings_len,
627 winclient->wmdesktop),
628 -1, 0, NULL, &output, NULL, NULL)) {
629 winclient->wmdesktopstr = g_strdup(_window_name_list_entry(
630 names.strings, names.strings_len, winclient->wmdesktop));
631 winclient->wmdesktopstr_len = g_utf8_strlen(output, -1);
632 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
635 winclient->wmdesktopstr = g_strdup(
"Invalid name");
636 winclient->wmdesktopstr_len =
637 g_utf8_strlen(winclient->wmdesktopstr, -1);
638 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
641 winclient->wmdesktopstr = g_markup_escape_text(
642 _window_name_list_entry(names.strings, names.strings_len,
643 winclient->wmdesktop),
645 winclient->wmdesktopstr_len =
646 g_utf8_strlen(winclient->wmdesktopstr, -1);
647 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
650 winclient->wmdesktopstr =
651 g_strdup_printf(
"%u", (uint32_t)winclient->wmdesktop);
652 winclient->wmdesktopstr_len =
653 g_utf8_strlen(winclient->wmdesktopstr, -1);
654 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
657 winclient->wmdesktopstr = g_strdup(
"");
658 winclient->wmdesktopstr_len =
659 g_utf8_strlen(winclient->wmdesktopstr, -1);
660 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
662 if (cd && winclient->wmdesktop != current_desktop) {
665 winlist_append(pd->ids, winclient->window, NULL);
670 xcb_ewmh_get_utf8_strings_reply_wipe(&names);
673 xcb_ewmh_get_windows_reply_wipe(&clients);
675 static int window_mode_init(
Mode *sw) {
677 WindowModePrivateData *pd = g_malloc0(
sizeof(*pd));
678 pd->window_regex = g_regex_new(
"{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL);
680 _window_mode_load_data(sw, FALSE);
681 if (!window_matching_fields_parsed) {
682 window_mode_parse_fields();
687 static int window_mode_init_cd(
Mode *sw) {
689 WindowModePrivateData *pd = g_malloc0(
sizeof(*pd));
690 pd->window_regex = g_regex_new(
"{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL);
692 _window_mode_load_data(sw, TRUE);
693 if (!window_matching_fields_parsed) {
694 window_mode_parse_fields();
700 static inline int act_on_window(xcb_window_t window) {
704 char window_regex[100];
706 g_snprintf(window_regex,
sizeof window_regex,
"%d", window);
709 window_regex, (
char *)0);
711 GError *error = NULL;
712 g_spawn_async(NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL,
715 char *msg = g_strdup_printf(
716 "Failed to execute action for window: '%s'\nError: '%s'", window_regex,
731 G_GNUC_UNUSED
char **input,
732 unsigned int selected_line) {
733 WindowModePrivateData *rmpd =
738 act_on_window(rmpd->ids->array[selected_line]);
745 uint32_t wmdesktop = 0;
746 xcb_get_property_cookie_t cookie;
747 xcb_get_property_reply_t *r;
749 unsigned int current_desktop = 0;
750 xcb_get_property_cookie_t c =
752 if (!xcb_ewmh_get_current_desktop_reply(&
xcb->
ewmh, c, ¤t_desktop,
757 cookie = xcb_get_property(
759 xcb->
ewmh._NET_WM_DESKTOP, XCB_ATOM_CARDINAL, 0, 1);
761 if (r && r->type == XCB_ATOM_CARDINAL) {
762 wmdesktop = *((uint32_t *)xcb_get_property_value(r));
764 if (r && r->type != XCB_ATOM_CARDINAL) {
766 wmdesktop = current_desktop;
771 if (wmdesktop != current_desktop) {
773 wmdesktop, XCB_CURRENT_TIME);
777 xcb_ewmh_request_change_active_window(
779 XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER, XCB_CURRENT_TIME,
784 xcb_ewmh_request_close_window(
786 XCB_CURRENT_TIME, XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER);
797 GError *error = NULL;
799 gsize lf_cmd_size = 0;
800 gchar *lf_cmd = g_locale_from_utf8(*input, -1, NULL, &lf_cmd_size, &error);
802 g_warning(
"Failed to convert command to locale encoding: %s",
810 run_in_term ? &context : NULL)) {
820 static void window_mode_destroy(
Mode *sw) {
821 WindowModePrivateData *rmpd =
824 winlist_free(rmpd->ids);
827 g_regex_unref(rmpd->window_regex);
833 const WindowModePrivateData *pd;
837 static void helper_eval_add_str(GString *str,
const char *input,
int l,
838 int max_len,
int nc) {
840 const char *input_nn = input ? input :
"";
844 spaces = MAX(0, max_len - nc);
845 g_string_append(str, input_nn);
848 int bl = g_utf8_offset_to_pointer(input_nn, l) - input_nn;
849 char *tmp = g_markup_escape_text(input_nn, bl);
850 g_string_append(str, tmp);
854 char *tmp = g_markup_escape_text(input_nn, -1);
855 g_string_append(str, tmp);
860 g_string_append_c(str,
' ');
863 static gboolean helper_eval_cb(
const GMatchInfo *info, GString *str,
865 struct arg *d = (
struct arg *)data;
868 match = g_match_info_fetch(info, 0);
871 if (match[2] ==
':') {
872 l = (int)g_ascii_strtoll(&match[3], NULL, 10);
877 if (match[1] ==
'w') {
878 helper_eval_add_str(str, d->c->wmdesktopstr, l, d->pd->wmdn_len,
879 d->c->wmdesktopstr_len);
880 }
else if (match[1] ==
'c') {
881 helper_eval_add_str(str, d->c->class, l, d->pd->clf_len,
882 g_utf8_strlen(d->c->class, -1));
883 }
else if (match[1] ==
't') {
884 helper_eval_add_str(str, d->c->title, l, d->pd->title_len,
885 g_utf8_strlen(d->c->title, -1));
886 }
else if (match[1] ==
'n') {
887 helper_eval_add_str(str, d->c->name, l, d->pd->name_len,
888 g_utf8_strlen(d->c->name, -1));
889 }
else if (match[1] ==
'r') {
890 helper_eval_add_str(str, d->c->role, l, d->pd->role_len,
891 g_utf8_strlen(d->c->role, -1));
898 static char *_generate_display_string(
const WindowModePrivateData *pd,
900 struct arg d = {pd, c};
902 0, 0, helper_eval_cb, &d, NULL);
903 return g_strchomp(res);
907 int *state, G_GNUC_UNUSED GList **list,
910 client *c = window_client(rmpd, rmpd->ids->array[selected_line]);
912 return get_entry ? g_strdup(
"Window has vanished") : NULL;
921 return get_entry ? _generate_display_string(rmpd, c) : NULL;
927 static cairo_user_data_key_t data_key;
934 static cairo_surface_t *draw_surface_from_data(
int width,
int height,
936 unsigned long int len = width * height;
938 uint32_t *buffer = g_new0(uint32_t, len);
939 cairo_surface_t *surface;
942 for (i = 0; i < len; i++) {
943 uint8_t a = (data[i] >> 24) & 0xff;
944 double alpha = a / 255.0;
945 uint8_t r = ((data[i] >> 16) & 0xff) * alpha;
946 uint8_t g = ((data[i] >> 8) & 0xff) * alpha;
947 uint8_t b = ((data[i] >> 0) & 0xff) * alpha;
948 buffer[i] = (a << 24) | (r << 16) | (g << 8) | b;
951 surface = cairo_image_surface_create_for_data(
952 (
unsigned char *)buffer, CAIRO_FORMAT_ARGB32, width, height, width * 4);
954 cairo_surface_set_user_data(surface, &data_key, buffer, g_free);
958 static cairo_surface_t *ewmh_window_icon_from_reply(xcb_get_property_reply_t *r,
959 uint32_t preferred_size) {
960 uint32_t *data, *end, *found_data = 0;
961 uint32_t found_size = 0;
963 if (!r || r->type != XCB_ATOM_CARDINAL || r->format != 32 || r->length < 2) {
967 data = (uint32_t *)xcb_get_property_value(r);
972 end = data + r->length;
978 while (data + 1 < end) {
981 uint64_t data_size = (uint64_t)data[0] * data[1];
982 if (data_size > (uint64_t)(end - data - 2)) {
988 uint32_t size = MAX(data[0], data[1]);
991 gboolean found_icon_too_small = found_size < preferred_size;
992 gboolean found_icon_too_large = found_size > preferred_size;
993 gboolean icon_empty = data[0] == 0 || data[1] == 0;
994 gboolean better_because_bigger = found_icon_too_small && size > found_size;
995 gboolean better_because_smaller =
996 found_icon_too_large && size >= preferred_size && size < found_size;
998 (better_because_bigger || better_because_smaller || found_size == 0)) {
1003 data += data_size + 2;
1010 return draw_surface_from_data(found_data[0], found_data[1], found_data + 2);
1013 static cairo_surface_t *get_net_wm_icon(xcb_window_t xid,
1014 uint32_t preferred_size) {
1015 xcb_get_property_cookie_t cookie = xcb_get_property_unchecked(
1018 xcb_get_property_reply_t *r =
1020 cairo_surface_t *surface = ewmh_window_icon_from_reply(r, preferred_size);
1024 static cairo_surface_t *
_get_icon(
const Mode *sw,
unsigned int selected_line,
1027 client *c = window_client(rmpd, rmpd->ids->array[selected_line]);
1033 c->thumbnail_checked = TRUE;
1035 if (c->icon == NULL && c->icon_checked == FALSE) {
1036 c->icon = get_net_wm_icon(rmpd->ids->array[selected_line], size);
1037 c->icon_checked = TRUE;
1039 if (c->icon == NULL && c->class) {
1040 if (c->icon_fetch_uid > 0) {
1043 char *class_lower = g_utf8_strdown(c->class, -1);
1045 g_free(class_lower);
1052 Mode window_mode = {.
name =
"window",
1053 .cfg_name_key =
"display-window",
1054 ._init = window_mode_init,
1055 ._get_num_entries = window_mode_get_num_entries,
1056 ._result = window_mode_result,
1057 ._destroy = window_mode_destroy,
1058 ._token_match = window_match,
1061 ._get_completion = NULL,
1062 ._preprocess_input = NULL,
1063 .private_data = NULL,
1065 Mode window_mode_cd = {.
name =
"windowcd",
1066 .cfg_name_key =
"display-windowcd",
1067 ._init = window_mode_init_cd,
1068 ._get_num_entries = window_mode_get_num_entries,
1069 ._result = window_mode_result,
1070 ._destroy = window_mode_destroy,
1071 ._token_match = window_match,
1074 ._get_completion = NULL,
1075 ._preprocess_input = NULL,
1076 .private_data = NULL,
static char * _get_display_value(const Mode *sw, unsigned int selected_line, int *state, G_GNUC_UNUSED GList **list, int get_entry)
static cairo_surface_t * _get_icon(const Mode *sw, unsigned int selected_line, int height)
gboolean helper_execute_command(const char *wd, const char *cmd, gboolean run_in_term, RofiHelperExecuteContext *context)
int helper_parse_setup(char *string, char ***output, int *length,...)
int helper_token_match(rofi_int_matcher *const *tokens, const char *input)
cairo_surface_t * rofi_icon_fetcher_get(const uint32_t uid)
uint32_t rofi_icon_fetcher_query(const char *name, const int size)
void mode_set_private_data(Mode *mode, void *pd)
void * mode_get_private_data(const Mode *mode)
void rofi_view_hide(void)
void rofi_view_reload(void)
xcb_window_t rofi_view_get_window(void)
int rofi_view_error_dialog(const char *msg, int markup)
char * window_match_fields
gboolean window_thumbnail
xcb_connection_t * connection
xcb_ewmh_connection_t ewmh
xcb_window_t focus_revert
ThemeWidget * rofi_config_find_widget(const char *name, const char *state, gboolean exact)
Property * rofi_theme_find_property(ThemeWidget *widget, PropertyType type, const char *property, gboolean exact)
cairo_surface_t * x11_helper_get_screenshot_surface_window(xcb_window_t window, int size)
WindowManagerQuirk current_window_manager
char * window_get_text_prop(xcb_window_t w, xcb_atom_t atom)
xcb_atom_t netatoms[NUM_NETATOMS]
@ WM_PANGO_WORKSPACE_NAMES
@ WM_DO_NOT_CHANGE_CURRENT_DESKTOP