[mutter/wip/focus: 5/5] display: Always use the key focused window for key events



commit 2d44f95f2bfea5270a2a4bd2cece0f549628bb6c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 25 19:44:18 2014 -0500

    display: Always use the key focused window for key events
    
    We no longer grab the actor's key focus, so this is necessary.

 src/core/display.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 8132663..d4c8d57 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1684,6 +1684,16 @@ get_window_for_event (MetaDisplay        *display,
   if (display->grab_op != META_GRAB_OP_NONE)
     return display->grab_window;
 
+  /* Always use the key focused window for key events. */
+  switch (event->type)
+    {
+    case CLUTTER_KEY_PRESS:
+    case CLUTTER_KEY_RELEASE:
+      return display->focus_window;
+    default:
+      break;
+    }
+
   source = clutter_event_get_source (event);
   if (META_IS_SURFACE_ACTOR_WAYLAND (source))
     {


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