[mutter/wayland] wayland: Send xdg_surface_focused_set / xdg_surface_focused_unset



commit 72a900787f93cae5d153fb416c0fed3428b8bdc9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 12 15:52:03 2013 -0500

    wayland: Send xdg_surface_focused_set / xdg_surface_focused_unset

 src/wayland/meta-wayland-keyboard.c |    4 ++++
 src/wayland/meta-wayland-surface.c  |   13 +++++++++++++
 src/wayland/meta-wayland-surface.h  |    3 +++
 3 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 944a2fb..6e24e36 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -498,6 +498,8 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
       serial = wl_display_next_serial (display);
       wl_keyboard_send_leave (resource, serial, keyboard->focus->resource);
       wl_list_remove (&keyboard->focus_listener.link);
+
+      meta_wayland_surface_focused_unset (keyboard->focus);
     }
 
   resource = find_resource_for_surface (&keyboard->resource_list, surface);
@@ -534,6 +536,8 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
        }
       wl_resource_add_destroy_listener (resource, &keyboard->focus_listener);
       keyboard->focus_serial = serial;
+
+      meta_wayland_surface_focused_set (keyboard->focus);
     }
 
   keyboard->focus_resource = resource;
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 3d37c3a..a754ea0 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1016,3 +1016,16 @@ meta_wayland_surface_configure_notify (MetaWaylandSurface *surface,
                                 0, 0 /* XXX: support this */);
 }
 
+void
+meta_wayland_surface_focused_set (MetaWaylandSurface *surface)
+{
+  if (surface->xdg_surface)
+    xdg_surface_send_focused_set (surface->xdg_surface->resource);
+}
+
+void
+meta_wayland_surface_focused_unset (MetaWaylandSurface *surface)
+{
+  if (surface->xdg_surface)
+    xdg_surface_send_focused_unset (surface->xdg_surface->resource);
+}
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index 0287f3e..a2fd75e 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -111,4 +111,7 @@ void                meta_wayland_surface_configure_notify (MetaWaylandSurface *s
                                                           int                 height,
                                                           int                 edges);
 
+void                meta_wayland_surface_focused_set (MetaWaylandSurface *surface);
+void                meta_wayland_surface_focused_unset (MetaWaylandSurface *surface);
+
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]