[mutter] wayland: Move appears-focused changed handling to window-wayland
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland: Move appears-focused changed handling to window-wayland
- Date: Mon, 12 May 2014 22:25:47 +0000 (UTC)
commit c49c37999c99d3780ea2a786936e66a4da92673d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon May 12 18:19:11 2014 -0400
wayland: Move appears-focused changed handling to window-wayland
src/core/window.c | 8 --------
src/wayland/window-wayland.c | 24 +++++++++++++++++++++++-
2 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index b832da4..d3165d9 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4892,14 +4892,6 @@ meta_window_appears_focused_changed (MetaWindow *window)
if (window->frame)
meta_frame_queue_draw (window->frame);
-
- if (window->surface)
- {
- if (meta_window_appears_focused (window))
- meta_wayland_surface_activated (window->surface);
- else
- meta_wayland_surface_deactivated (window->surface);
- }
}
/**
diff --git a/src/wayland/window-wayland.c b/src/wayland/window-wayland.c
index 0e4f43e..4e805fd 100644
--- a/src/wayland/window-wayland.c
+++ b/src/wayland/window-wayland.c
@@ -186,8 +186,30 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
}
static void
-meta_window_wayland_init (MetaWindowWayland *window_wayland)
+appears_focused_changed (GObject *object,
+ GParamSpec *pspec,
+ gpointer user_data)
{
+ MetaWindow *window = META_WINDOW (object);
+
+ /* When we're unmanaging, we remove focus from the window,
+ * causing this to fire. Don't do anything in that case. */
+ if (window->unmanaging)
+ return;
+
+ if (meta_window_appears_focused (window))
+ meta_wayland_surface_activated (window->surface);
+ else
+ meta_wayland_surface_deactivated (window->surface);
+}
+
+static void
+meta_window_wayland_init (MetaWindowWayland *wl_window)
+{
+ MetaWindow *window = META_WINDOW (wl_window);
+
+ g_signal_connect (window, "notify::appears-focused",
+ G_CALLBACK (appears_focused_changed), NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]