From 09599861ac726b142a79ed60035809f04c151457 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Wed, 8 Feb 2023 03:20:31 -0500 Subject: [PATCH] xwayland: Fix size issue when starting VLC fullscreen --- include/view.h | 7 +++++++ src/xwayland.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/view.h b/include/view.h index d00c9a98..0d3e5e0f 100644 --- a/include/view.h +++ b/include/view.h @@ -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); diff --git a/src/xwayland.c b/src/xwayland.c index bb0f7e6c..d85247bc 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -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}); }