From 36ae716e4d9c28047299d35b1dc50930d2ebefd6 Mon Sep 17 00:00:00 2001 From: msizanoen1 Date: Tue, 29 Nov 2022 21:29:15 +0700 Subject: [PATCH] window/xwayland: Relayout when fullscreen client update emulated RandR mode This fixes an issue when GLFW tries to change the display resolution while fullscreen where the application window size doesn't get updated according to the emulated resolution. Part-of: --- src/wayland/meta-window-xwayland.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wayland/meta-window-xwayland.c b/src/wayland/meta-window-xwayland.c index ce44c5bc0..fcb593348 100644 --- a/src/wayland/meta-window-xwayland.c +++ b/src/wayland/meta-window-xwayland.c @@ -300,6 +300,20 @@ meta_window_xwayland_set_property (GObject *object, } } +static void +meta_window_xwayland_process_property_notify (MetaWindow *window, + XPropertyEvent *event) +{ + MetaWindowX11Class *parent_class = + META_WINDOW_X11_CLASS (meta_window_xwayland_parent_class); + + parent_class->process_property_notify (window, event); + + if (event->atom == window->display->x11_display->atom__XWAYLAND_RANDR_EMU_MONITOR_RECTS && + meta_window_is_fullscreen (window)) + meta_window_queue (window, META_QUEUE_MOVE_RESIZE); +} + static void meta_window_xwayland_class_init (MetaWindowXwaylandClass *klass) { @@ -315,6 +329,7 @@ meta_window_xwayland_class_init (MetaWindowXwaylandClass *klass) window_x11_class->freeze_commits = meta_window_xwayland_freeze_commits; window_x11_class->thaw_commits = meta_window_xwayland_thaw_commits; window_x11_class->always_update_shape = meta_window_xwayland_always_update_shape; + window_x11_class->process_property_notify = meta_window_xwayland_process_property_notify; gobject_class->get_property = meta_window_xwayland_get_property; gobject_class->set_property = meta_window_xwayland_set_property;