rofi 2.0.0
wayland-window.c
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2022 Qball Cow <qball@gmpclient.org>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 */
27
29#define G_LOG_DOMAIN "Modes.Window"
30
31#include "config.h"
32
33#ifdef WINDOW_MODE
34
35#include <stdint.h>
36
37#include <glib.h>
38#include <wayland-client.h>
39
40#include "display.h"
41#include "helper.h"
43#include "rofi.h"
44#include "settings.h"
45#include "wayland-internal.h"
46#include "widgets/textbox.h"
47
48#include "mode-private.h"
49#include "rofi-icon-fetcher.h"
50
51#include "wlr-foreign-toplevel-management-unstable-v1-protocol.h"
52
53#define WLR_FOREIGN_TOPLEVEL_VERSION 3
54
55enum WaylandWindowMatchingFields {
56 WW_MATCH_FIELD_TITLE = 1 << 0,
57 WW_MATCH_FIELD_APP_ID = 1 << 1,
58 WW_MATCH_FIELD_ALL = ~0,
59};
60
61typedef struct _WaylandWindowModePrivateData {
62 wayland_stuff *wayland;
63 struct wl_registry *registry;
64 struct zwlr_foreign_toplevel_manager_v1 *manager;
65 GList *toplevels; /* List of ForeignToplevelHandle */
66
67 /* initial rendering complete, updates allowed */
68 gboolean visible;
69 int match_fields; /* bitmask of WaylandWindowMatchingFields */
70 glong title_len;
71 glong app_id_len;
72 GRegex *window_regex;
73} WaylandWindowModePrivateData;
74
75enum ForeignToplevelState {
76 TOPLEVEL_STATE_MAXIMIZED = 1
77 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MAXIMIZED,
78 TOPLEVEL_STATE_MINIMIZED = 1
79 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MINIMIZED,
80 TOPLEVEL_STATE_ACTIVATED = 1
81 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED,
82 TOPLEVEL_STATE_FULLSCREEN =
83 1 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN,
84 TOPLEVEL_STATE_CLOSED = 1 << 4
85};
86
87typedef struct {
88 struct zwlr_foreign_toplevel_handle_v1 *handle;
89 WaylandWindowModePrivateData *view;
90
91 gchar *app_id;
92 glong app_id_len;
93 gchar *title;
94 glong title_len;
95 int state;
96
97 unsigned int cached_icon_uid;
98 unsigned int cached_icon_size;
99 guint cached_icon_scale;
100} ForeignToplevelHandle;
101
102static void foreign_toplevel_handle_free(ForeignToplevelHandle *self) {
103
104 if (self->handle) {
105 zwlr_foreign_toplevel_handle_v1_destroy(self->handle);
106 self->handle = NULL;
107 }
108 g_free(self->title);
109 g_free(self->app_id);
110 g_free(self);
111}
112
113static void toplevels_list_update_max_len(gpointer data, gpointer user_data) {
114 WaylandWindowModePrivateData *pd = (WaylandWindowModePrivateData *)user_data;
115 ForeignToplevelHandle *entry = (ForeignToplevelHandle *)data;
116
117 pd->title_len = MAX(entry->title_len, pd->title_len);
118 pd->app_id_len = MAX(entry->app_id_len, pd->app_id_len);
119}
120
121/* Update column alignment and schedule reload */
122static void wayland_window_update_toplevel(ForeignToplevelHandle *toplevel) {
123 WaylandWindowModePrivateData *pd = toplevel->view;
124
125 if (!pd->visible) {
126 /* initial fetch, just add the current item */
127 toplevels_list_update_max_len(toplevel, pd);
128 } else {
129 /* async update, recalculate from scratch */
130 pd->title_len = 0;
131 pd->app_id_len = 0;
132 g_list_foreach(pd->toplevels, toplevels_list_update_max_len, pd);
134 }
135}
136
137/* requests */
138
139static void foreign_toplevel_handle_activate(ForeignToplevelHandle *self,
140 struct wl_seat *seat) {
141 zwlr_foreign_toplevel_handle_v1_activate(self->handle, seat);
142}
143
144static void foreign_toplevel_handle_close(ForeignToplevelHandle *self) {
145 zwlr_foreign_toplevel_handle_v1_close(self->handle);
146}
147
148/* events */
149
150static void foreign_toplevel_handle_title(
151 void *data, G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle,
152 const char *title) {
153 ForeignToplevelHandle *self = (ForeignToplevelHandle *)data;
154 if (self->title) {
155 g_free(self->title);
156 }
157 self->title = g_strdup(title);
158 self->title_len = g_utf8_strlen(self->title, -1);
159}
160
161static void foreign_toplevel_handle_app_id(
162 void *data, G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle,
163 const char *app_id) {
164 ForeignToplevelHandle *self = (ForeignToplevelHandle *)data;
165 if (self->app_id) {
166 g_free(self->app_id);
167 }
168 self->app_id = g_strdup(app_id);
169 self->app_id_len = g_utf8_strlen(self->app_id, -1);
170}
171
172static void foreign_toplevel_handle_output_enter(
173 G_GNUC_UNUSED void *data,
174 G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle,
175 G_GNUC_UNUSED struct wl_output *output) {
176 /* ignore */
177}
178
179static void foreign_toplevel_handle_output_leave(
180 G_GNUC_UNUSED void *data,
181 G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle,
182 G_GNUC_UNUSED struct wl_output *output) {
183 /* ignore */
184}
185
186static void foreign_toplevel_handle_state(
187 void *data, G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle,
188 struct wl_array *value) {
189 ForeignToplevelHandle *self = (ForeignToplevelHandle *)data;
190 uint32_t *elem;
191
192 self->state = 0;
193 wl_array_for_each(elem, value) { self->state |= 1 << *elem; }
194}
195
196static void foreign_toplevel_handle_done(
197 void *data, G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle) {
198 ForeignToplevelHandle *self = (ForeignToplevelHandle *)data;
199
200 g_debug("window %p id=%s title=%s state=%d\n", (void *)self, self->app_id,
201 self->title, self->state);
202
203 wayland_window_update_toplevel(self);
204}
205
206static void foreign_toplevel_handle_closed(
207 void *data, G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle) {
208 ForeignToplevelHandle *self = (ForeignToplevelHandle *)data;
209
210 /* the handle is inert and will receive no further events */
211 self->state = TOPLEVEL_STATE_CLOSED;
212 self->view->toplevels = g_list_remove(self->view->toplevels, self);
213 wayland_window_update_toplevel(self);
214 foreign_toplevel_handle_free(self);
215}
216
217static void foreign_toplevel_handle_parent(
218 G_GNUC_UNUSED void *data,
219 G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *handle,
220 G_GNUC_UNUSED struct zwlr_foreign_toplevel_handle_v1 *parent) {
221 /* ignore */
222}
223
224static struct zwlr_foreign_toplevel_handle_v1_listener
225 foreign_toplevel_handle_listener = {
226 .title = &foreign_toplevel_handle_title,
227 .app_id = &foreign_toplevel_handle_app_id,
228 .output_enter = &foreign_toplevel_handle_output_enter,
229 .output_leave = &foreign_toplevel_handle_output_leave,
230 .state = &foreign_toplevel_handle_state,
231 .done = &foreign_toplevel_handle_done,
232 .closed = &foreign_toplevel_handle_closed,
233 .parent = &foreign_toplevel_handle_parent};
234
235static ForeignToplevelHandle *
236foreign_toplevel_handle_new(struct zwlr_foreign_toplevel_handle_v1 *handle,
237 WaylandWindowModePrivateData *view) {
238 ForeignToplevelHandle *self =
239 (ForeignToplevelHandle *)g_malloc0(sizeof(ForeignToplevelHandle));
240
241 self->handle = handle;
242 self->view = view;
243 zwlr_foreign_toplevel_handle_v1_add_listener(
244 handle, &foreign_toplevel_handle_listener, self);
245 return self;
246}
247
248static void foreign_toplevel_manager_toplevel(
249 void *data, G_GNUC_UNUSED struct zwlr_foreign_toplevel_manager_v1 *manager,
250 struct zwlr_foreign_toplevel_handle_v1 *toplevel) {
251 WaylandWindowModePrivateData *pd = (WaylandWindowModePrivateData *)data;
252
253 ForeignToplevelHandle *handle = foreign_toplevel_handle_new(toplevel, pd);
254 pd->toplevels = g_list_prepend(pd->toplevels, handle);
255}
256
257static void foreign_toplevel_manager_finished(
258 G_GNUC_UNUSED void *data,
259 struct zwlr_foreign_toplevel_manager_v1 *manager) {
260 zwlr_foreign_toplevel_manager_v1_destroy(manager);
261}
262
263static struct zwlr_foreign_toplevel_manager_v1_listener
264 foreign_toplevel_manager_listener = {
265 .toplevel = &foreign_toplevel_manager_toplevel,
266 .finished = &foreign_toplevel_manager_finished};
267
268static void handle_global(void *data, struct wl_registry *registry,
269 uint32_t name, const char *interface,
270 uint32_t version) {
271 WaylandWindowModePrivateData *pd = (WaylandWindowModePrivateData *)data;
272
273 if (g_strcmp0(interface, zwlr_foreign_toplevel_manager_v1_interface.name) ==
274 0) {
275
276 pd->manager = (struct zwlr_foreign_toplevel_manager_v1 *)wl_registry_bind(
277 registry, name, &zwlr_foreign_toplevel_manager_v1_interface,
278 MIN(version, WLR_FOREIGN_TOPLEVEL_VERSION));
279 }
280}
281
282static void handle_global_remove(G_GNUC_UNUSED void *data,
283 G_GNUC_UNUSED struct wl_registry *registry,
284 G_GNUC_UNUSED uint32_t name) {}
285
286static struct wl_registry_listener registry_listener = {
287 .global = &handle_global, .global_remove = &handle_global_remove};
288
289static int wayland_window_mode_parse_fields(void) {
290 int result = 0;
291 char *savept = NULL;
292 // Make a copy, as strtok will modify it.
293 char *switcher_str = g_strdup(config.window_match_fields);
294
295 const char *const sep = ",#";
296 for (char *token = strtok_r(switcher_str, sep, &savept); token != NULL;
297 token = strtok_r(NULL, sep, &savept)) {
298 if (g_strcmp0(token, "all") == 0) {
299 result |= WW_MATCH_FIELD_ALL;
300
301 } else if (g_strcmp0(token, "title") == 0) {
302 result |= WW_MATCH_FIELD_TITLE;
303
304 } else if (g_strcmp0(token, "class") == 0 ||
305 g_strcmp0(token, "app-id") == 0) {
306 result |= WW_MATCH_FIELD_APP_ID;
307
308 } else {
309 g_warning("Unsupported window field name :%s. "
310 "Wayland window switcher supports only 'title' and 'app-id' "
311 "('class') fields",
312 token);
313 }
314 }
315 g_free(switcher_str);
316 return result;
317}
318
319static void get_wayland_window(Mode *sw) {
320 WaylandWindowModePrivateData *pd =
321 (WaylandWindowModePrivateData *)mode_get_private_data(sw);
322
323 pd->match_fields = wayland_window_mode_parse_fields();
324 pd->window_regex = g_regex_new("{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL);
325
326 pd->wayland = wayland;
327
328 pd->registry = wl_display_get_registry(wayland->display);
329 wl_registry_add_listener(pd->registry, &registry_listener, pd);
330 wl_display_roundtrip(wayland->display);
331
332 if (pd->manager == NULL) {
333 g_warning("Unable to initialize Window mode: Wayland compositor does not "
334 "support wlr-foreign-toplevel-management protocol");
335 return;
336 }
337
338 zwlr_foreign_toplevel_manager_v1_add_listener(
339 pd->manager, &foreign_toplevel_manager_listener, pd);
340 /* fetch initial set of windows */
341 wl_display_roundtrip(wayland->display);
342 pd->visible = TRUE;
343}
344
345static void toplevels_list_item_free(gpointer data,
346 G_GNUC_UNUSED gpointer user_data) {
347 foreign_toplevel_handle_free((ForeignToplevelHandle *)data);
348}
349
350static void wayland_window_private_free(WaylandWindowModePrivateData *pd) {
351 if (pd->toplevels) {
352 g_list_foreach(pd->toplevels, toplevels_list_item_free, NULL);
353 g_list_free(pd->toplevels);
354 pd->toplevels = NULL;
355 }
356
357 if (pd->registry) {
358 wl_registry_destroy(pd->registry);
359 pd->registry = NULL;
360 }
361
362 if (pd->manager) {
363 zwlr_foreign_toplevel_manager_v1_stop(pd->manager);
364 pd->manager = NULL;
365 wl_display_roundtrip(pd->wayland->display);
366 }
367
368 if (pd->window_regex) {
369 g_regex_unref(pd->window_regex);
370 }
371
372 g_free(pd);
373}
374
375static int wayland_window_mode_init(Mode *sw) {
379 if (mode_get_private_data(sw) == NULL) {
380 WaylandWindowModePrivateData *pd =
381 (WaylandWindowModePrivateData *)g_malloc0(
382 sizeof(WaylandWindowModePrivateData));
383 mode_set_private_data(sw, (void *)pd);
384
385 get_wayland_window(sw);
386 }
387 return TRUE;
388}
389
390static unsigned int wayland_window_mode_get_num_entries(const Mode *sw) {
391 const WaylandWindowModePrivateData *pd =
392 (const WaylandWindowModePrivateData *)mode_get_private_data(sw);
393
394 g_return_val_if_fail(pd != NULL, 0);
395
396 return g_list_length(pd->toplevels);
397}
398
399static ModeMode wayland_window_mode_result(Mode *sw, int mretv,
400 G_GNUC_UNUSED char **input,
401 unsigned int selected_line) {
402 ModeMode retv = MODE_EXIT;
403 WaylandWindowModePrivateData *pd =
404 (WaylandWindowModePrivateData *)mode_get_private_data(sw);
405
406 g_return_val_if_fail(pd != NULL, retv);
407
408 if (mretv & MENU_NEXT) {
409 retv = NEXT_DIALOG;
410 } else if (mretv & MENU_PREVIOUS) {
411 retv = PREVIOUS_DIALOG;
412 } else if (mretv & MENU_QUICK_SWITCH) {
413 retv = (ModeMode)(mretv & MENU_LOWER_MASK);
414 } else if ((mretv & MENU_OK)) {
416 ForeignToplevelHandle *toplevel =
417 (ForeignToplevelHandle *)g_list_nth_data(pd->toplevels, selected_line);
418 foreign_toplevel_handle_activate(toplevel, pd->wayland->last_seat->seat);
419 wl_display_flush(pd->wayland->display);
420
421 } else if ((mretv & MENU_ENTRY_DELETE) == MENU_ENTRY_DELETE) {
422 ForeignToplevelHandle *toplevel =
423 (ForeignToplevelHandle *)g_list_nth_data(pd->toplevels, selected_line);
424 foreign_toplevel_handle_close(toplevel);
425 wl_display_flush(pd->wayland->display);
426 }
427
428 return retv;
429}
430
431static void wayland_window_mode_destroy(Mode *sw) {
432 WaylandWindowModePrivateData *pd =
433 (WaylandWindowModePrivateData *)mode_get_private_data(sw);
434
435 if (pd == NULL) {
436 return;
437 }
438
439 wayland_window_private_free(pd);
440 mode_set_private_data(sw, NULL);
441}
442
443static int wayland_window_token_match(const Mode *sw, rofi_int_matcher **tokens,
444 unsigned int index) {
445 WaylandWindowModePrivateData *pd =
446 (WaylandWindowModePrivateData *)mode_get_private_data(sw);
447 ForeignToplevelHandle *toplevel =
448 (ForeignToplevelHandle *)g_list_nth_data(pd->toplevels, index);
449
450 g_return_val_if_fail(toplevel != NULL, 0);
451
452 int match = TRUE;
453
454 if (tokens) {
455 for (int j = 0; match && tokens[j] != NULL; j++) {
456 int test = 0;
457 /* See comment in window.c;
458 * for each token we want to match at least one field.
459 */
460 rofi_int_matcher *ftokens[2] = {tokens[j], NULL};
461
462 if ((pd->match_fields & WW_MATCH_FIELD_TITLE) &&
463 toplevel->title != NULL && toplevel->title[0] != '\0') {
464 test = helper_token_match(ftokens, toplevel->title);
465 }
466
467 if (test == tokens[j]->invert &&
468 (pd->match_fields & WW_MATCH_FIELD_APP_ID) &&
469 toplevel->app_id != NULL && toplevel->app_id[0] != '\0') {
470 test = helper_token_match(ftokens, toplevel->app_id);
471 }
472
473 if (test == 0) {
474 match = 0;
475 }
476 }
477 }
478
479 return match;
480}
481
482static void helper_eval_add_str(GString *str, const char *input, int len,
483 int max_len, int nc) {
484 // g_utf8 does not work with NULL string.
485 const char *input_nn = input ? input : "";
486 // Both len and max_len are in characters, not bytes.
487 int spaces = 0;
488 if (len > 0) {
489 if (nc > len) {
490 int bl = g_utf8_offset_to_pointer(input_nn, len) - input_nn;
491 char *tmp = g_markup_escape_text(input_nn, bl);
492 g_string_append(str, tmp);
493 g_free(tmp);
494 } else {
495 spaces = len - nc;
496 char *tmp = g_markup_escape_text(input_nn, -1);
497 g_string_append(str, tmp);
498 g_free(tmp);
499 }
500 } else {
501 char *tmp = g_markup_escape_text(input_nn, -1);
502 g_string_append(str, tmp);
503 g_free(tmp);
504 if (len == 0) {
505 spaces = MAX(0, max_len - nc);
506 }
507 }
508 while (spaces--) {
509 g_string_append_c(str, ' ');
510 }
511}
512
513struct arg {
514 const WaylandWindowModePrivateData *pd;
515 ForeignToplevelHandle *toplevel;
516};
517
518static gboolean helper_eval_cb(const GMatchInfo *info, GString *str,
519 gpointer data) {
520 struct arg *d = (struct arg *)data;
521 gchar *match;
522 // Get the match
523 match = g_match_info_fetch(info, 0);
524 if (match != NULL) {
525 int l = 0;
526 if (match[2] == ':') {
527 l = (int)g_ascii_strtoll(&match[3], NULL, 10);
528 }
529 /* Most of the arguments are not supported on wayland */
530 switch (match[1]) {
531 case 't': /* title */
532 helper_eval_add_str(str, d->toplevel->title, l, d->pd->title_len,
533 d->toplevel->title_len);
534 break;
535 case 'a': /* app_id */
536 case 'c': /* class */
537 helper_eval_add_str(str, d->toplevel->app_id, l, d->pd->app_id_len,
538 d->toplevel->app_id_len);
539 break;
540 }
541
542 g_free(match);
543 }
544 return FALSE;
545}
546
547static char *_generate_display_string(const WaylandWindowModePrivateData *pd,
548 ForeignToplevelHandle *toplevel) {
549
550 struct arg d = {pd, toplevel};
551 char *res = g_regex_replace_eval(pd->window_regex, config.window_format, -1,
552 0, 0, helper_eval_cb, &d, NULL);
553 return g_strchomp(res);
554}
555
556static char *_get_display_value(const Mode *sw, unsigned int selected_line,
557 int *state, G_GNUC_UNUSED GList **attr_list,
558 int get_entry) {
559 WaylandWindowModePrivateData *pd =
560 (WaylandWindowModePrivateData *)mode_get_private_data(sw);
561
562 g_return_val_if_fail(pd != NULL, NULL);
563
564 ForeignToplevelHandle *toplevel =
565 (ForeignToplevelHandle *)g_list_nth_data(pd->toplevels, selected_line);
566
567 if (toplevel == NULL || toplevel->state & TOPLEVEL_STATE_CLOSED) {
568 return get_entry ? g_strdup("Window has vanished") : NULL;
569 }
570
571 /* This may not work because layer-surface holds focus */
572 if (toplevel->state & TOPLEVEL_STATE_ACTIVATED) {
573 *state |= ACTIVE;
574 }
575 *state |= MARKUP;
576
577 return get_entry ? _generate_display_string(pd, toplevel) : NULL;
578}
579
580static cairo_surface_t *_get_icon(const Mode *sw, unsigned int selected_line,
581 unsigned int height) {
582 WaylandWindowModePrivateData *pd =
583 (WaylandWindowModePrivateData *)mode_get_private_data(sw);
584 const guint scale = display_scale();
585
586 g_return_val_if_fail(pd != NULL, NULL);
587
588 ForeignToplevelHandle *toplevel =
589 (ForeignToplevelHandle *)g_list_nth_data(pd->toplevels, selected_line);
590
591 /* some apps don't have app_id (WM_CLASS). this is fine */
592 if (toplevel == NULL || toplevel->app_id == NULL ||
593 toplevel->app_id[0] == '\0') {
594 return NULL;
595 }
596
597 if (toplevel->cached_icon_uid > 0 && toplevel->cached_icon_size == height &&
598 toplevel->cached_icon_scale == scale) {
599 return rofi_icon_fetcher_get(toplevel->cached_icon_uid);
600 }
601
607 gchar *app_id_lower = g_utf8_strdown(toplevel->app_id, -1);
608 toplevel->cached_icon_size = height;
609 toplevel->cached_icon_scale = scale;
610 toplevel->cached_icon_uid = rofi_icon_fetcher_query(app_id_lower, height);
611 g_free(app_id_lower);
612
613 return rofi_icon_fetcher_get(toplevel->cached_icon_uid);
614}
615
616#include "mode-private.h"
617
618Mode wayland_window_mode = {.name = "window",
619 .cfg_name_key = "display-window",
620 ._init = wayland_window_mode_init,
621 ._destroy = wayland_window_mode_destroy,
622 ._get_num_entries =
623 wayland_window_mode_get_num_entries,
624 ._result = wayland_window_mode_result,
625 ._token_match = wayland_window_token_match,
626 ._get_display_value = _get_display_value,
627 ._get_icon = _get_icon,
628 ._get_completion = NULL,
629 ._preprocess_input = NULL,
630 ._get_message = NULL,
631 .private_data = NULL,
632 .free = NULL,
633 .type = MODE_TYPE_SWITCHER};
634
635#endif // WINDOW_MODE
guint display_scale(void)
Definition display.c:42
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)
int helper_token_match(rofi_int_matcher *const *tokens, const char *input)
Definition helper.c:541
cairo_surface_t * rofi_icon_fetcher_get(const uint32_t uid)
uint32_t rofi_icon_fetcher_query(const char *name, const int size)
struct rofi_mode Mode
Definition mode.h:49
void * mode_get_private_data(const Mode *mode)
Definition mode.c:176
void mode_set_private_data(Mode *mode, void *pd)
Definition mode.c:181
ModeMode
Definition mode.h:54
@ MENU_LOWER_MASK
Definition mode.h:92
@ MENU_PREVIOUS
Definition mode.h:86
@ MENU_QUICK_SWITCH
Definition mode.h:82
@ MENU_ENTRY_DELETE
Definition mode.h:80
@ MENU_NEXT
Definition mode.h:76
@ MENU_OK
Definition mode.h:72
@ MODE_EXIT
Definition mode.h:56
@ NEXT_DIALOG
Definition mode.h:58
@ PREVIOUS_DIALOG
Definition mode.h:62
@ ACTIVE
Definition textbox.h:109
@ MARKUP
Definition textbox.h:113
void rofi_view_hide(void)
Definition view.c:2155
void rofi_view_reload(void)
Definition view.c:2157
@ MODE_TYPE_SWITCHER
struct rofi_int_matcher_t rofi_int_matcher
Settings config
wayland_stuff * wayland
Definition display.c:114