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 <derek.foreman@collabora.com>
dev
Derek Foreman 2 years ago
parent 93b58c5648
commit 8763f3800e
  1. 1
      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;

Loading…
Cancel
Save