summaryrefslogtreecommitdiff
path: root/src/wayland
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2018-01-09 13:19:40 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2018-01-11 11:03:04 +0100
commitbd9a3008014d1063aac75241ff750798cbe5aaee (patch)
tree4cce41c1e1463c14fc7c0a6196b61350fd989df7 /src/wayland
parent2d090f92326745f75c0bda8fab0eace454895342 (diff)
downloadmutter-bd9a3008014d1063aac75241ff750798cbe5aaee.tar.gz
window: Defer stack placement without a buffer
When closing a window and showing a new one, the new one may not be granted input focus until it gets a buffer on Wayland. If another window is chosen to receive focus and raised on top of stack, the newly mapped window is focused but placed underneath that other window. Meaning that for Wayland surfaces, we need to defer adding the window to the stack until we actually get to show it, once we have a buffer attached. Rather that checking the windowing backend prior to decide if a window is stackable or not, introduce a new vfunc is_stackable() which tells if a window should be added to the stack regardless of the underlying windowing system. Also add meta_window_is_in_stack() API rather than checking the stack position directly (replacing the define WINDOW_IN_STACK only available in stack.c) and remove a window from the stack only if it is present in the stack, so that the test in meta_stack_remote() becomes irrelevant. https://bugzilla.gnome.org/show_bug.cgi?id=780820
Diffstat (limited to 'src/wayland')
-rw-r--r--src/wayland/meta-window-wayland.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index f3f0e1688..d5d8e21b0 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -543,6 +543,12 @@ meta_window_wayland_shortcuts_inhibited (MetaWindow *window,
return meta_wayland_compositor_is_shortcuts_inhibited (compositor, source);
}
+static gboolean
+meta_window_wayland_is_stackable (MetaWindow *window)
+{
+ return meta_wayland_surface_get_buffer (window->surface) != NULL;
+}
+
static void
meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
{
@@ -562,6 +568,7 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
window_class->get_client_pid = meta_window_wayland_get_client_pid;
window_class->force_restore_shortcuts = meta_window_wayland_force_restore_shortcuts;
window_class->shortcuts_inhibited = meta_window_wayland_shortcuts_inhibited;
+ window_class->is_stackable = meta_window_wayland_is_stackable;
}
MetaWindow *