29#define G_LOG_DOMAIN "Modes.Window"
43#include <xcb/xcb_atom.h>
44#include <xcb/xcb_ewmh.h>
45#include <xcb/xcb_icccm.h>
66#define CLIENTWINDOWTYPE 10
75 WIN_MATCH_FIELD_TITLE,
76 WIN_MATCH_FIELD_CLASS,
79 WIN_MATCH_FIELD_DESKTOP,
81} WinModeMatchingFields;
83static WinModeField matching_window_fields[WIN_MATCH_NUM_FIELDS] = {
85 .field_name =
"title",
89 .field_name =
"class",
101 .field_name =
"desktop",
105static 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 uint32_t icon_fetch_size;
129 gboolean thumbnail_checked;
145 unsigned int wmdn_len;
146 unsigned int clf_len;
147 unsigned int name_len;
148 unsigned int title_len;
149 unsigned int role_len;
150 GRegex *window_regex;
152 gboolean hide_active_window;
153} WindowModePrivateData;
155winlist *cache_client = NULL;
162static winlist *winlist_new() {
163 winlist *l = g_malloc(
sizeof(winlist));
165 l->array = g_malloc_n(WINLIST + 1,
sizeof(xcb_window_t));
166 l->data = g_malloc_n(WINLIST + 1,
sizeof(client *));
179static int winlist_append(winlist *l, xcb_window_t w, client *d) {
180 if (l->len > 0 && !(l->len % WINLIST)) {
182 g_realloc(l->array,
sizeof(xcb_window_t) * (l->len + WINLIST + 1));
183 l->data = g_realloc(l->data,
sizeof(client *) * (l->len + WINLIST + 1));
187 if (l->data == NULL || l->array == NULL) {
192 l->array[l->len++] = w;
196static void client_free(client *c) {
201 cairo_surface_destroy(c->icon);
207 g_free(c->wmdesktopstr);
209static void winlist_empty(winlist *l) {
211 client *c = l->data[--l->len];
224static void winlist_free(winlist *l) {
241static int winlist_find(winlist *l, xcb_window_t w) {
249 for (i = (l->len - 1); i >= 0; i--) {
250 if (l->array[i] == w) {
260static void x11_cache_create(
void) {
261 if (cache_client == NULL) {
262 cache_client = winlist_new();
269static void x11_cache_free(
void) {
270 winlist_free(cache_client);
283static xcb_get_window_attributes_reply_t *
284window_get_attributes(xcb_window_t w) {
285 xcb_get_window_attributes_cookie_t c =
287 xcb_get_window_attributes_reply_t *r =
295static int client_has_state(client *c, xcb_atom_t state) {
296 for (
int i = 0; i < c->states; i++) {
297 if (c->state[i] == state) {
304static int client_has_window_type(client *c, xcb_atom_t type) {
305 for (
int i = 0; i < c->window_types; i++) {
306 if (c->window_type[i] == type) {
314static client *window_client(WindowModePrivateData *pd, xcb_window_t win) {
315 if (win == XCB_WINDOW_NONE) {
319 int idx = winlist_find(cache_client, win);
322 return cache_client->data[idx];
326 xcb_get_window_attributes_reply_t *attr = window_get_attributes(win);
331 client *c = g_malloc0(
sizeof(client));
335 memmove(&c->xattr, attr,
sizeof(xcb_get_window_attributes_reply_t));
337 xcb_get_property_cookie_t cky = xcb_ewmh_get_wm_state(&
xcb->
ewmh, win);
338 xcb_ewmh_get_atoms_reply_t states;
339 if (xcb_ewmh_get_wm_state_reply(&
xcb->
ewmh, cky, &states, NULL)) {
340 c->states = MIN(CLIENTSTATE, states.atoms_len);
341 memcpy(c->state, states.atoms,
342 MIN(CLIENTSTATE, states.atoms_len) *
sizeof(xcb_atom_t));
343 xcb_ewmh_get_atoms_reply_wipe(&states);
345 cky = xcb_ewmh_get_wm_window_type(&
xcb->
ewmh, win);
346 if (xcb_ewmh_get_wm_window_type_reply(&
xcb->
ewmh, cky, &states, NULL)) {
347 c->window_types = MIN(CLIENTWINDOWTYPE, states.atoms_len);
348 memcpy(c->window_type, states.atoms,
349 MIN(CLIENTWINDOWTYPE, states.atoms_len) *
sizeof(xcb_atom_t));
350 xcb_ewmh_get_atoms_reply_wipe(&states);
354 if (tmp_title == NULL) {
357 c->title = g_markup_escape_text(tmp_title, -1);
359 MAX(c->title ? g_utf8_strlen(c->title, -1) : 0, pd->title_len);
363 c->role = g_markup_escape_text(tmp_role ? tmp_role :
"", -1);
364 pd->role_len = MAX(c->role ? g_utf8_strlen(c->role, -1) : 0, pd->role_len);
368 xcb_icccm_get_wm_class_reply_t wcr;
369 if (xcb_icccm_get_wm_class_reply(
xcb->
connection, cky, &wcr, NULL)) {
370 c->class = g_markup_escape_text(wcr.class_name, -1);
371 c->name = g_markup_escape_text(wcr.instance_name, -1);
372 pd->name_len = MAX(c->name ? g_utf8_strlen(c->name, -1) : 0, pd->name_len);
373 xcb_icccm_get_wm_class_reply_wipe(&wcr);
376 xcb_get_property_cookie_t cc =
378 xcb_icccm_wm_hints_t r;
379 if (xcb_icccm_get_wm_hints_reply(
xcb->
connection, cc, &r, NULL)) {
380 c->hint_flags = r.flags;
383 winlist_append(cache_client, c->window, c);
388guint window_reload_timeout = 0;
389static gboolean window_client_reload(G_GNUC_UNUSED
void *data) {
390 window_reload_timeout = 0;
391 if (window_mode.private_data) {
392 window_mode._destroy(&window_mode);
393 window_mode._init(&window_mode);
395 if (window_mode_cd.private_data) {
396 window_mode._destroy(&window_mode_cd);
397 window_mode._init(&window_mode_cd);
399 if (window_mode.private_data || window_mode_cd.private_data) {
402 return G_SOURCE_REMOVE;
404void window_client_handle_signal(G_GNUC_UNUSED xcb_window_t win,
405 G_GNUC_UNUSED gboolean create) {
407 if (window_reload_timeout > 0) {
408 g_source_remove(window_reload_timeout);
409 window_reload_timeout = 0;
411 window_reload_timeout = g_timeout_add(100, window_client_reload, NULL);
414 unsigned int index) {
415 WindowModePrivateData *rmpd =
418 const winlist *ids = (winlist *)rmpd->ids;
420 int idx = winlist_find(cache_client, ids->array[index]);
422 client *c = cache_client->data[idx];
425 for (
int j = 0; match && tokens[j] != NULL; j++) {
432 if (c->title != NULL && c->title[0] !=
'\0' &&
433 matching_window_fields[WIN_MATCH_FIELD_TITLE].enabled) {
437 if (test == tokens[j]->invert && c->class != NULL &&
438 c->class[0] !=
'\0' &&
439 matching_window_fields[WIN_MATCH_FIELD_CLASS].enabled) {
443 if (test == tokens[j]->invert && c->role != NULL && c->role[0] !=
'\0' &&
444 matching_window_fields[WIN_MATCH_FIELD_ROLE].enabled) {
448 if (test == tokens[j]->invert && c->name != NULL && c->name[0] !=
'\0' &&
449 matching_window_fields[WIN_MATCH_FIELD_NAME].enabled) {
452 if (test == tokens[j]->invert && c->wmdesktopstr != NULL &&
453 c->wmdesktopstr[0] !=
'\0' &&
454 matching_window_fields[WIN_MATCH_FIELD_DESKTOP].enabled) {
467static void window_mode_parse_fields() {
468 window_matching_fields_parsed = TRUE;
472 const char *
const sep =
",#";
474 for (
unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++) {
475 matching_window_fields[i].enabled = FALSE;
477 for (
char *token = strtok_r(switcher_str, sep, &savept); token != NULL;
478 token = strtok_r(NULL, sep, &savept)) {
479 if (strcmp(token,
"all") == 0) {
480 for (
unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++) {
481 matching_window_fields[i].enabled = TRUE;
485 gboolean matched = FALSE;
486 for (
unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++) {
487 const char *field_name = matching_window_fields[i].field_name;
488 if (strcmp(token, field_name) == 0) {
489 matching_window_fields[i].enabled = TRUE;
494 g_warning(
"Invalid window field name :%s", token);
498 g_free(switcher_str);
501static unsigned int window_mode_get_num_entries(
const Mode *sw) {
502 const WindowModePrivateData *pd =
505 return pd->ids ? pd->ids->len : 0;
511const char *invalid_desktop_name =
"n/a";
512static const char *_window_name_list_entry(
const char *str, uint32_t length,
516 while (index < entry && offset < length) {
517 if (str[offset] == 0) {
522 if (offset >= length) {
523 return invalid_desktop_name;
527static void _window_mode_load_data(
Mode *sw,
unsigned int cd) {
528 WindowModePrivateData *pd =
531 xcb_window_t curr_win_id;
537 xcb_get_property_cookie_t c =
539 if (!xcb_ewmh_get_active_window_reply(&
xcb->
ewmh, c, &curr_win_id, NULL)) {
544 unsigned int current_desktop = 0;
546 if (!xcb_ewmh_get_current_desktop_reply(&
xcb->
ewmh, c, ¤t_desktop,
553 xcb_ewmh_get_windows_reply_t clients = {
556 if (xcb_ewmh_get_client_list_stacking_reply(&
xcb->
ewmh, c, &clients, NULL)) {
560 if (xcb_ewmh_get_client_list_reply(&
xcb->
ewmh, c, &clients, NULL)) {
568 if (clients.windows_len > 0) {
573 pd->ids = winlist_new();
575 xcb_get_property_cookie_t prop_cookie =
577 xcb_ewmh_get_utf8_strings_reply_t names;
578 int has_names = FALSE;
579 if (xcb_ewmh_get_desktop_names_reply(&
xcb->
ewmh, prop_cookie, &names,
584 for (i = clients.windows_len - 1; i > -1; i--) {
585 client *winclient = window_client(pd, clients.windows[i]);
586 if ((winclient != NULL) && !winclient->xattr.override_redirect &&
587 !client_has_window_type(winclient,
588 xcb->
ewmh._NET_WM_WINDOW_TYPE_DOCK) &&
589 !client_has_window_type(winclient,
590 xcb->
ewmh._NET_WM_WINDOW_TYPE_DESKTOP) &&
591 !client_has_state(winclient,
xcb->
ewmh._NET_WM_STATE_SKIP_PAGER) &&
592 !client_has_state(winclient,
xcb->
ewmh._NET_WM_STATE_SKIP_TASKBAR)) {
594 MAX(pd->clf_len, (winclient->class != NULL)
595 ? (g_utf8_strlen(winclient->class, -1))
598 if (client_has_state(winclient,
599 xcb->
ewmh._NET_WM_STATE_DEMANDS_ATTENTION)) {
600 winclient->demands = TRUE;
602 if ((winclient->hint_flags & XCB_ICCCM_WM_HINT_X_URGENCY) != 0) {
603 winclient->demands = TRUE;
606 if (winclient->window == curr_win_id) {
607 winclient->active = TRUE;
610 xcb_get_property_cookie_t cookie;
611 xcb_get_property_reply_t *r;
613 winclient->wmdesktop = 0xFFFFFFFF;
614 cookie = xcb_get_property(
xcb->
connection, 0, winclient->window,
615 xcb->
ewmh._NET_WM_DESKTOP, XCB_ATOM_CARDINAL,
619 if (r->type == XCB_ATOM_CARDINAL) {
620 winclient->wmdesktop = *((uint32_t *)xcb_get_property_value(r));
624 if (winclient->wmdesktop != 0xFFFFFFFF) {
629 if (pango_parse_markup(
630 _window_name_list_entry(names.strings, names.strings_len,
631 winclient->wmdesktop),
632 -1, 0, NULL, &output, NULL, NULL)) {
633 winclient->wmdesktopstr = g_strdup(_window_name_list_entry(
634 names.strings, names.strings_len, winclient->wmdesktop));
635 winclient->wmdesktopstr_len = g_utf8_strlen(output, -1);
636 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
639 winclient->wmdesktopstr = g_strdup(
"Invalid name");
640 winclient->wmdesktopstr_len =
641 g_utf8_strlen(winclient->wmdesktopstr, -1);
642 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
645 winclient->wmdesktopstr = g_markup_escape_text(
646 _window_name_list_entry(names.strings, names.strings_len,
647 winclient->wmdesktop),
649 winclient->wmdesktopstr_len =
650 g_utf8_strlen(winclient->wmdesktopstr, -1);
651 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
654 winclient->wmdesktopstr =
655 g_strdup_printf(
"%u", (uint32_t)winclient->wmdesktop);
656 winclient->wmdesktopstr_len =
657 g_utf8_strlen(winclient->wmdesktopstr, -1);
658 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
661 winclient->wmdesktopstr = g_strdup(
"");
662 winclient->wmdesktopstr_len =
663 g_utf8_strlen(winclient->wmdesktopstr, -1);
664 pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
666 if (cd && winclient->wmdesktop != current_desktop) {
669 if (!pd->hide_active_window || winclient->window != curr_win_id) {
670 winlist_append(pd->ids, winclient->window, NULL);
676 xcb_ewmh_get_utf8_strings_reply_wipe(&names);
679 xcb_ewmh_get_windows_reply_wipe(&clients);
681static int window_mode_init(
Mode *sw) {
684 WindowModePrivateData *pd = g_malloc0(
sizeof(*pd));
689 pd->hide_active_window = TRUE;
691 pd->window_regex = g_regex_new(
"{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL);
693 _window_mode_load_data(sw, FALSE);
694 if (!window_matching_fields_parsed) {
695 window_mode_parse_fields();
700static int window_mode_init_cd(
Mode *sw) {
702 WindowModePrivateData *pd = g_malloc0(
sizeof(*pd));
708 pd->hide_active_window = TRUE;
710 pd->window_regex = g_regex_new(
"{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL);
712 _window_mode_load_data(sw, TRUE);
713 if (!window_matching_fields_parsed) {
714 window_mode_parse_fields();
720static inline int act_on_window(xcb_window_t window) {
724 char window_regex[100];
726 g_snprintf(window_regex,
sizeof window_regex,
"%d", window);
729 window_regex, (
char *)0);
731 GError *error = NULL;
732 g_spawn_async(NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL,
735 char *msg = g_strdup_printf(
736 "Failed to execute action for window: '%s'\nError: '%s'", window_regex,
751 G_GNUC_UNUSED
char **input,
752 unsigned int selected_line) {
753 WindowModePrivateData *rmpd =
758 act_on_window(rmpd->ids->array[selected_line]);
765 uint32_t wmdesktop = 0;
766 xcb_get_property_cookie_t cookie;
767 xcb_get_property_reply_t *r;
769 unsigned int current_desktop = 0;
770 xcb_get_property_cookie_t c =
772 if (!xcb_ewmh_get_current_desktop_reply(&
xcb->
ewmh, c, ¤t_desktop,
777 cookie = xcb_get_property(
779 xcb->
ewmh._NET_WM_DESKTOP, XCB_ATOM_CARDINAL, 0, 1);
781 if (r && r->type == XCB_ATOM_CARDINAL) {
782 wmdesktop = *((uint32_t *)xcb_get_property_value(r));
784 if (r && r->type != XCB_ATOM_CARDINAL) {
786 wmdesktop = current_desktop;
791 if (wmdesktop != current_desktop) {
793 wmdesktop, XCB_CURRENT_TIME);
797 xcb_ewmh_request_change_active_window(
799 XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER, XCB_CURRENT_TIME,
804 xcb_ewmh_request_close_window(
806 XCB_CURRENT_TIME, XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER);
817 GError *error = NULL;
819 gsize lf_cmd_size = 0;
820 gchar *lf_cmd = g_locale_from_utf8(*input, -1, NULL, &lf_cmd_size, &error);
822 g_warning(
"Failed to convert command to locale encoding: %s",
830 run_in_term ? &context : NULL)) {
840static void window_mode_destroy(
Mode *sw) {
841 WindowModePrivateData *rmpd =
844 winlist_free(rmpd->ids);
847 g_regex_unref(rmpd->window_regex);
853 const WindowModePrivateData *pd;
857static void helper_eval_add_str(GString *str,
const char *input,
int l,
858 int max_len,
int nc) {
860 const char *input_nn = input ? input :
"";
864 spaces = MAX(0, max_len - nc);
865 g_string_append(str, input_nn);
868 int bl = g_utf8_offset_to_pointer(input_nn, l) - input_nn;
869 char *tmp = g_markup_escape_text(input_nn, bl);
870 g_string_append(str, tmp);
874 char *tmp = g_markup_escape_text(input_nn, -1);
875 g_string_append(str, tmp);
880 g_string_append_c(str,
' ');
883static gboolean helper_eval_cb(
const GMatchInfo *info, GString *str,
885 struct arg *d = (
struct arg *)data;
888 match = g_match_info_fetch(info, 0);
891 if (match[2] ==
':') {
892 l = (int)g_ascii_strtoll(&match[3], NULL, 10);
897 if (match[1] ==
'w') {
898 helper_eval_add_str(str, d->c->wmdesktopstr, l, d->pd->wmdn_len,
899 d->c->wmdesktopstr_len);
900 }
else if (match[1] ==
'c') {
901 helper_eval_add_str(str, d->c->class, l, d->pd->clf_len,
902 g_utf8_strlen(d->c->class, -1));
903 }
else if (match[1] ==
't') {
904 helper_eval_add_str(str, d->c->title, l, d->pd->title_len,
905 g_utf8_strlen(d->c->title, -1));
906 }
else if (match[1] ==
'n') {
907 helper_eval_add_str(str, d->c->name, l, d->pd->name_len,
908 g_utf8_strlen(d->c->name, -1));
909 }
else if (match[1] ==
'r') {
910 helper_eval_add_str(str, d->c->role, l, d->pd->role_len,
911 g_utf8_strlen(d->c->role, -1));
918static char *_generate_display_string(
const WindowModePrivateData *pd,
920 struct arg d = {pd, c};
922 0, 0, helper_eval_cb, &d, NULL);
923 return g_strchomp(res);
927 int *state, G_GNUC_UNUSED GList **list,
930 client *c = window_client(rmpd, rmpd->ids->array[selected_line]);
932 return get_entry ? g_strdup(
"Window has vanished") : NULL;
941 return get_entry ? _generate_display_string(rmpd, c) : NULL;
947static cairo_user_data_key_t data_key;
955static cairo_surface_t *draw_surface_from_data(
int width,
int height,
956 uint32_t
const *
const data) {
957 unsigned long int len = width * height;
959 uint32_t *buffer = g_new0(uint32_t, len);
960 cairo_surface_t *surface;
963 for (i = 0; i < len; i++) {
964 uint8_t a = (data[i] >> 24) & 0xff;
965 double alpha = a / 255.0;
966 uint8_t r = ((data[i] >> 16) & 0xff) * alpha;
967 uint8_t g = ((data[i] >> 8) & 0xff) * alpha;
968 uint8_t b = ((data[i] >> 0) & 0xff) * alpha;
969 buffer[i] = (a << 24) | (r << 16) | (g << 8) | b;
972 surface = cairo_image_surface_create_for_data(
973 (
unsigned char *)buffer, CAIRO_FORMAT_ARGB32, width, height, width * 4);
975 cairo_surface_set_user_data(surface, &data_key, buffer, g_free);
979static cairo_surface_t *ewmh_window_icon_from_reply(xcb_get_property_reply_t *r,
980 uint32_t preferred_size) {
981 uint32_t *data, *end, *found_data = 0;
982 uint32_t found_size = 0;
984 if (!r || r->type != XCB_ATOM_CARDINAL || r->format != 32 || r->length < 2) {
988 data = (uint32_t *)xcb_get_property_value(r);
993 end = data + r->length;
999 while (data + 1 < end) {
1002 uint64_t data_size = (uint64_t)data[0] * data[1];
1003 if (data_size > (uint64_t)(end - data - 2)) {
1010 uint32_t size = MAX(data[0], data[1]);
1013 gboolean found_icon_too_small = found_size < preferred_size;
1014 gboolean found_icon_too_large = found_size > preferred_size;
1015 gboolean icon_empty = data[0] == 0 || data[1] == 0;
1016 gboolean better_because_bigger = found_icon_too_small && size > found_size;
1017 gboolean better_because_smaller =
1018 found_icon_too_large && size >= preferred_size && size < found_size;
1020 (better_because_bigger || better_because_smaller || found_size == 0)) {
1025 data += data_size + 2;
1032 return draw_surface_from_data(found_data[0], found_data[1], found_data + 2);
1035static cairo_surface_t *get_net_wm_icon(xcb_window_t xid,
1036 uint32_t preferred_size) {
1037 xcb_get_property_cookie_t cookie = xcb_get_property_unchecked(
1040 xcb_get_property_reply_t *r =
1042 cairo_surface_t *surface = ewmh_window_icon_from_reply(r, preferred_size);
1046static cairo_surface_t *
_get_icon(
const Mode *sw,
unsigned int selected_line,
1047 unsigned int size) {
1049 client *c = window_client(rmpd, rmpd->ids->array[selected_line]);
1053 if (c->icon_fetch_size != size) {
1055 cairo_surface_destroy(c->icon);
1058 c->thumbnail_checked = FALSE;
1059 c->icon_checked = FALSE;
1063 c->thumbnail_checked = TRUE;
1065 if (c->icon == NULL && c->icon_checked == FALSE) {
1066 c->icon = get_net_wm_icon(rmpd->ids->array[selected_line], size);
1067 c->icon_checked = TRUE;
1069 if (c->icon == NULL && c->class) {
1070 if (c->icon_fetch_uid > 0) {
1073 char *class_lower = g_utf8_strdown(c->class, -1);
1075 g_free(class_lower);
1076 c->icon_fetch_size = size;
1079 c->icon_fetch_size = size;
1084Mode window_mode = {.
name =
"window",
1085 .cfg_name_key =
"display-window",
1086 ._init = window_mode_init,
1087 ._get_num_entries = window_mode_get_num_entries,
1088 ._result = window_mode_result,
1089 ._destroy = window_mode_destroy,
1090 ._token_match = window_match,
1093 ._get_completion = NULL,
1094 ._preprocess_input = NULL,
1095 .private_data = NULL,
1097Mode window_mode_cd = {.
name =
"windowcd",
1098 .cfg_name_key =
"display-windowcd",
1099 ._init = window_mode_init_cd,
1100 ._get_num_entries = window_mode_get_num_entries,
1101 ._result = window_mode_result,
1102 ._destroy = window_mode_destroy,
1103 ._token_match = window_match,
1106 ._get_completion = NULL,
1107 ._preprocess_input = NULL,
1108 .private_data = NULL,
static cairo_surface_t * _get_icon(const Mode *sw, unsigned int selected_line, unsigned int height)
static char * _get_display_value(const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **attr_list, int get_entry)
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_get_private_data(const Mode *mode)
void mode_set_private_data(Mode *mode, void *pd)
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
Property * rofi_theme_find_property(ThemeWidget *widget, PropertyType type, const char *property, gboolean exact)
ThemeWidget * rofi_config_find_widget(const char *name, const char *state, gboolean exact)
char * window_get_text_prop(xcb_window_t w, xcb_atom_t atom)
WindowManagerQuirk current_window_manager
xcb_atom_t netatoms[NUM_NETATOMS]
cairo_surface_t * x11_helper_get_screenshot_surface_window(xcb_window_t window, int size)
@ WM_PANGO_WORKSPACE_NAMES
@ WM_DO_NOT_CHANGE_CURRENT_DESKTOP