]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: Implement set_decorations
authorJoshua Ashton <joshua@froggi.es>
Wed, 20 Oct 2021 16:06:32 +0000 (16:06 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 20 Oct 2021 17:49:02 +0000 (18:49 +0100)
Fixes games going between borderless and normal windowed modes.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
include/labwc.h
src/xwayland.c

index 6ab051822cfbf1d25ca9bb9470e7574895b47d11..2f32ed7ca4bfe581955b07ea3225392664a03a0e 100644 (file)
@@ -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 */
 };
index d7e5ae6fe6bff99da2a1de29e0f686b964f1313d..8d40185310cf2de472bee3115eade02649d41801 100644 (file)
@@ -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);
 }