1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-06-02 18:31:59 -04:00

Wayland: real fullscreen support

See #64
This commit is contained in:
lbonn 2023-02-11 00:12:21 +01:00
parent 93b2a1ad33
commit f8bec1453c
5 changed files with 22 additions and 0 deletions

View file

@ -49,6 +49,7 @@ typedef struct _display_proxy {
void (*set_input_focus)(guint window);
void (*revert_input_focus)(void);
char *(*get_clipboard_data)(int type);
void (*set_fullscreen_mode)();
guint (*scale)(void);

View file

@ -129,4 +129,6 @@ enum clipboard_type {
char *display_get_clipboard_data(enum clipboard_type);
void display_set_fullscreen_mode(void);
#endif

View file

@ -44,3 +44,5 @@ guint display_scale(void) { return proxy->scale(); }
char *display_get_clipboard_data(enum clipboard_type type) {
return proxy->get_clipboard_data(type);
}
void display_set_fullscreen_mode(void) { return proxy->set_fullscreen_mode(); }

View file

@ -1403,6 +1403,18 @@ static char *wayland_get_clipboard_data(int type) {
return NULL;
}
static void wayland_set_fullscreen_mode() {
if (!wayland->wlr_surface) {
return;
}
zwlr_layer_surface_v1_set_exclusive_zone(wayland->wlr_surface, -1);
zwlr_layer_surface_v1_set_size(wayland->wlr_surface, 0, 0);
wl_surface_commit(wayland->surface);
wl_display_roundtrip(wayland->display);
rofi_view_pool_refresh();
}
static display_proxy display_ = {
.setup = wayland_display_setup,
.late_setup = wayland_display_late_setup,
@ -1415,6 +1427,7 @@ static display_proxy display_ = {
.revert_input_focus = wayland_display_revert_input_focus,
.scale = wayland_display_scale,
.get_clipboard_data = wayland_get_clipboard_data,
.set_fullscreen_mode = wayland_set_fullscreen_mode,
.view = wayland_display_view_proxy,
};

View file

@ -286,6 +286,10 @@ static void wayland___create_window(MenuFlags menu_flags) {
WlState.fullscreen = rofi_theme_get_boolean(WIDGET(win), "fullscreen", FALSE);
if (WlState.fullscreen) {
display_set_fullscreen_mode();
}
widget_free(WIDGET(win));
TICK_N("done");