summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-03-17 04:52:44 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-04-25 21:55:05 -0300
commit762a3f89a99c42fff1022c5cbea9b1a5af42c646 (patch)
tree2e23cabef581aa78cb1261165d6860cf4569d1e3
parent822c2666f5b7aa3c9ea0b6b3ee72b1d936ed7c9f (diff)
downloadmutter-762a3f89a99c42fff1022c5cbea9b1a5af42c646.tar.gz
wayland: Add function to query if window needs move or resize
This will be used by the next commit to determine when a window geometry change should be ignored or not. Normally, it would be enough to just check if the position and sizes changed. The position, in this case, is relative to the client buffer, not the global position. But because it is not global, there is one, admitedly unlikely, situation where the window state is updated while the client size and relative positions don't change. One can trigger this by e.g. tiling the window to the half-left of the monitor, then immediately tile it to half-right. In this case, the window didn't change, just it's state, but nonetheless we need to notify the compositor and run the full move/resize routines. When that case happens, though, the MetaWindowWayland is tracking the pending state change or a move. And this is what we need to expose. https://bugzilla.gnome.org/show_bug.cgi?id=780292 Issue: #78
-rw-r--r--src/wayland/meta-window-wayland.c7
-rw-r--r--src/wayland/meta-window-wayland.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index b0a7de14c..705bc4981 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -915,3 +915,10 @@ meta_window_wayland_get_max_size (MetaWindow *window,
scale_size (width, height, scale);
}
+gboolean
+meta_window_wayland_needs_move_resize (MetaWindow *window)
+{
+ MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window);
+
+ return wl_window->has_pending_state_change || wl_window->has_pending_move;
+}
diff --git a/src/wayland/meta-window-wayland.h b/src/wayland/meta-window-wayland.h
index 408451626..ea5b82cb2 100644
--- a/src/wayland/meta-window-wayland.h
+++ b/src/wayland/meta-window-wayland.h
@@ -78,5 +78,6 @@ void meta_window_wayland_get_max_size (MetaWindow *window,
int *width,
int *height);
+gboolean meta_window_wayland_needs_move_resize (MetaWindow *window);
#endif