]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Bump xdg-shell version from 3 to 6
authortokyo4j <hrak1529@gmail.com>
Mon, 9 Jun 2025 21:50:41 +0000 (06:50 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 13 Jun 2025 19:43:12 +0000 (20:43 +0100)
- Send xdg_toplevel.wm_capabilities
- Send xdg_toplevel.configure_bounds so that clients can map a window that
  fits within the usable area, without relying on
  view_constrain_size_to_that_of_usable_area() which is called after map.
- (The new "suspended" state should be handled by wlr_scene in the future)

src/xdg.c

index a31550e55857447f72e813629e647348a99a38df..c2da35b7e8c854db9c3c9d3f14ccca8591cc3b5b 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -18,7 +18,7 @@
 #include "window-rules.h"
 #include "workspaces.h"
 
-#define LAB_XDG_SHELL_VERSION (3)
+#define LAB_XDG_SHELL_VERSION 6
 #define CONFIGURE_TIMEOUT_MS 100
 
 static struct xdg_toplevel_view *
@@ -139,6 +139,19 @@ handle_commit(struct wl_listener *listener, void *data)
                if (serial > 0) {
                        set_pending_configure_serial(view, serial);
                }
+
+               uint32_t wm_caps = WLR_XDG_TOPLEVEL_WM_CAPABILITIES_WINDOW_MENU
+                       | WLR_XDG_TOPLEVEL_WM_CAPABILITIES_MAXIMIZE
+                       | WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN
+                       | WLR_XDG_TOPLEVEL_WM_CAPABILITIES_MINIMIZE;
+               wlr_xdg_toplevel_set_wm_capabilities(toplevel, wm_caps);
+
+               if (view->output) {
+                       wlr_xdg_toplevel_set_bounds(toplevel,
+                               view->output->usable_area.width,
+                               view->output->usable_area.height);
+               }
+
                /*
                 * Handle initial fullscreen/maximize requests immediately after
                 * scheduling the initial configure event (before it is sent) in