send XDG fullscreen state to Wayland clients

Add client_set_fullscreen backend vtable entry. Call
wlr_xdg_toplevel_set_fullscreen on enter/leave so clients
(e.g. Firefox) know to render content at full size.
This commit is contained in:
lkn 2026-06-23 20:40:57 +02:00
parent dd1302a711
commit 321df47493
5 changed files with 18 additions and 0 deletions

View File

@ -1033,6 +1033,9 @@ void wFullscreenWindow(WWindow *wwin)
wwin->flags.fullscreen = True;
if (wm_backend->client_set_fullscreen)
wm_backend->client_set_fullscreen(wwin->client_win, 1);
wWindowConfigureBorders(wwin);
ChangeStackingLevel(wwin->frame->core, WMFullscreenLevel);
@ -1059,6 +1062,9 @@ void wUnfullscreenWindow(WWindow *wwin)
wwin->flags.fullscreen = False;
if (wm_backend->client_set_fullscreen)
wm_backend->client_set_fullscreen(wwin->client_win, 0);
if (wwin->frame->core->stacking->window_level == WMFullscreenLevel) {
if (WFLAGP(wwin, sunken)) {
ChangeStackingLevel(wwin->frame->core, WMSunkenLevel);

View File

@ -1540,6 +1540,7 @@ typedef struct WMBackend {
* X11: no-op (handled via _NET_WM_STATE property).
* Wayland: sends xdg_toplevel set_maximized/set_fullscreen. */
void (*client_set_maximized)(WNativeWindow win, int maximized);
void (*client_set_fullscreen)(WNativeWindow win, int fullscreen);
/*
* Send a WM_PROTOCOLS message to a client (e.g. WM_DELETE_WINDOW).

View File

@ -568,6 +568,14 @@ void wl_client_set_maximized(WNativeWindow win, int maximized)
wlr_xdg_toplevel_set_maximized(v->xdg_surface->toplevel, maximized);
}
void wl_client_set_fullscreen(WNativeWindow win, int fullscreen)
{
struct wl_toplevel_view *v = wl_find_view_by_id(win);
if (!v) return;
if (v->xdg_surface && v->xdg_surface->toplevel)
wlr_xdg_toplevel_set_fullscreen(v->xdg_surface->toplevel, fullscreen);
}
void wl_client_send_protocol(WWindow *wwin, unsigned long protocol,
unsigned long timestamp)
{

View File

@ -48,6 +48,7 @@ void *wl_create_rimage_from_drawable(void *rcontext, WMDrawable drawable);
void wl_icon_update_pixmap(WIcon *icon);
void wl_client_set_state(WWindow *wwin, int state, WNativeWindow icon_win);
void wl_client_set_maximized(WNativeWindow win, int maximized);
void wl_client_set_fullscreen(WNativeWindow win, int fullscreen);
void wl_client_send_protocol(WWindow *wwin, unsigned long protocol, unsigned long timestamp);
void wl_client_kill_impl(WWindow *wwin);
char *wl_get_command_for_window(WNativeWindow win, int elements);
@ -462,6 +463,7 @@ const WMBackend wl_backend = {
.client_restore = wl_noop_client_restore,
.client_set_state = wl_client_set_state,
.client_set_maximized = wl_client_set_maximized,
.client_set_fullscreen = wl_client_set_fullscreen,
.client_send_protocol = wl_client_send_protocol,
.client_kill = wl_client_kill_impl,
.client_get_colormap_windows = wl_noop_client_get_colormap_windows,

View File

@ -4906,6 +4906,7 @@ const WMBackend x11_backend = {
.client_restore = x11_client_restore,
.client_set_state = x11_client_set_state,
.client_set_maximized = NULL, /* X11: handled via _NET_WM_STATE property */
.client_set_fullscreen = NULL, /* X11: handled via _NET_WM_STATE property */
.client_send_protocol = x11_client_send_protocol,
.client_kill = x11_client_kill,
.client_get_colormap_windows = x11_client_get_colormap_windows,