]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: Fix size issue when starting VLC fullscreen
authorJohn Lindgren <john@jlindgren.net>
Wed, 8 Feb 2023 08:20:31 +0000 (03:20 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 8 Feb 2023 22:15:14 +0000 (22:15 +0000)
include/view.h
src/xwayland.c

index d00c9a9887d987de60ccdca81f8f0fbcb4c6c7cd..0d3e5e0f71ea3648f6c3b209153e24ad769e95b0 100644 (file)
@@ -106,6 +106,13 @@ struct xdg_toplevel_view {
        struct wl_listener new_popup;
 };
 
+static inline bool
+view_is_floating(struct view *view)
+{
+       return !view->fullscreen && !view->maximized && !view->tiled
+               && !view->tiled_region;
+}
+
 void view_set_activated(struct view *view);
 void view_close(struct view *view);
 
index bb0f7e6ca5d498c248d5d3357b2aa48573aff283..d85247bc1731e2c9d42aed982da79605280be056 100644 (file)
@@ -280,6 +280,20 @@ handle_request_configure(struct wl_listener *listener, void *data)
        int height = event->height;
        view_adjust_size(view, &width, &height);
 
+       /*
+        * If a configure request is received while maximized/
+        * fullscreen/tiled, update the natural geometry only. This
+        * appears to be the desired behavior e.g. when starting VLC in
+        * fullscreen mode.
+        */
+       if (!view_is_floating(view)) {
+               view->natural_geometry.x = event->x;
+               view->natural_geometry.y = event->y;
+               view->natural_geometry.width = width;
+               view->natural_geometry.height = height;
+               return;
+       }
+
        configure(view, (struct wlr_box){event->x, event->y, width, height});
 }