From 0a7f1b51f77c49bab325bcb8293c47ab822a6fa0 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 20 Oct 2021 16:06:32 +0000 Subject: [PATCH] xwayland: Implement set_decorations Fixes games going between borderless and normal windowed modes. Signed-off-by: Joshua Ashton --- include/labwc.h | 1 + src/xwayland.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/labwc.h b/include/labwc.h index 6ab05182..2f32ed7c 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -278,6 +278,7 @@ struct view { struct wl_listener request_fullscreen; struct wl_listener set_title; struct wl_listener set_app_id; /* class on xwayland */ + struct wl_listener set_decorations; /* xwayland only */ struct wl_listener new_popup; /* xdg-shell only */ struct wl_listener new_subsurface; /* xdg-shell only */ }; diff --git a/src/xwayland.c b/src/xwayland.c index d7e5ae6f..8d401853 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -208,6 +208,12 @@ want_deco(struct view *view) WLR_XWAYLAND_SURFACE_DECORATIONS_ALL; } +static void +handle_set_decorations(struct wl_listener *listener, void *data) { + struct view *view = wl_container_of(listener, view, set_decorations); + view_set_decorations(view, want_deco(view)); +} + static void top_left_edge_boundary_check(struct view *view) { @@ -365,5 +371,9 @@ xwayland_surface_new(struct wl_listener *listener, void *data) view->set_app_id.notify = handle_set_class; wl_signal_add(&xsurface->events.set_class, &view->set_app_id); + view->set_decorations.notify = handle_set_decorations; + wl_signal_add(&xsurface->events.set_decorations, + &view->set_decorations); + wl_list_insert(&view->server->views, &view->link); } -- 2.52.0