From 8763f3800e1d6ec6cf696eb6c6274424b60935ab Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 6 Jun 2022 13:34:12 -0500 Subject: [PATCH] xwayland: Update net_wm state when we change it. According to the wm-spec we must keep the _NET_WM_STATE property updated to reflect the current state of the window. This has been biting me when firefox starts maximized, then I click the maximize button to toggle to unmaximized state. The next time I mouse over the maximize button (which causes the frame to be re-rendered with the maximized button in a highlighted state) we re-read the window state and weston then believes the window is maximized even though it is being rendered in a not-maximized state. Update the state when we change maximized status so this doesn't happen. Signed-off-by: Derek Foreman --- xwayland/window-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 41dddd23..dc5f8f9e 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -2176,6 +2176,7 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) if (frame_status(window->frame) & FRAME_STATUS_MAXIMIZE) { window->maximized_horz = !window->maximized_horz; window->maximized_vert = !window->maximized_vert; + weston_wm_window_set_net_wm_state(window); if (weston_wm_window_is_maximized(window)) { window->saved_width = window->width; window->saved_height = window->height;