[mutter/wayland] pointer: Don't send modifiers on mouse enter



commit 48f7232492a83f6fbe0a80f0332602ac38217877
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 18 23:18:44 2014 -0500

    pointer: Don't send modifiers on mouse enter
    
    I talked to Kristian about this. It should be enough to simply
    send it when we activate the surface and give it keyboard focus.

 src/wayland/meta-wayland-keyboard.c |   31 +++----------------------------
 src/wayland/meta-wayland-pointer.c  |   25 -------------------------
 2 files changed, 3 insertions(+), 53 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 9d41f98..9b54fcb 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -60,14 +60,6 @@
 
 #include "meta-wayland-private.h"
 
-static MetaWaylandSeat *
-meta_wayland_keyboard_get_seat (MetaWaylandKeyboard *keyboard)
-{
-  MetaWaylandSeat *seat = wl_container_of (keyboard, seat, keyboard);
-
-  return seat;
-}
-
 static int
 create_anonymous_file (off_t size,
                        GError **error)
@@ -291,28 +283,11 @@ default_grab_modifiers (MetaWaylandKeyboardGrab *grab, uint32_t serial,
                         uint32_t mods_locked, uint32_t group)
 {
   MetaWaylandKeyboard *keyboard = grab->keyboard;
-  MetaWaylandSeat *seat = meta_wayland_keyboard_get_seat (keyboard);
-  MetaWaylandPointer *pointer = &seat->pointer;
-  struct wl_resource *resource, *pr;
-
-  resource = keyboard->focus_resource;
-  if (!resource)
-    return;
-
-  wl_keyboard_send_modifiers (resource, serial, mods_depressed,
-                              mods_latched, mods_locked, group);
 
-  if (pointer && pointer->focus_surface && pointer->focus_surface != keyboard->focus_surface)
+  if (keyboard->focus_resource)
     {
-      pr = find_resource_for_surface (&keyboard->resource_list, pointer->focus_surface);
-      if (pr)
-        {
-          wl_keyboard_send_modifiers (pr, serial,
-                                     mods_depressed,
-                                      mods_latched,
-                                      mods_locked,
-                                      group);
-        }
+      wl_keyboard_send_modifiers (keyboard->focus_resource, serial, mods_depressed,
+                                  mods_latched, mods_locked, group);
     }
 }
 
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 7f6a4af..907003f 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -55,14 +55,6 @@
 
 static void meta_wayland_pointer_end_popup_grab (MetaWaylandPointer *pointer);
 
-static MetaWaylandSeat *
-meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer)
-{
-  MetaWaylandSeat *seat = wl_container_of (pointer, seat, pointer);
-
-  return seat;
-}
-
 static void
 release_focus (MetaWaylandPointer *pointer)
 {
@@ -331,9 +323,6 @@ void
 meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
                                 MetaWaylandSurface *surface)
 {
-  MetaWaylandSeat *seat = meta_wayland_pointer_get_seat (pointer);
-  MetaWaylandKeyboard *kbd = &seat->keyboard;
-
   if (pointer->focus_surface == surface && pointer->focus_resource != NULL)
     return;
 
@@ -371,20 +360,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
           struct wl_display *display = wl_client_get_display (client);
           uint32_t serial = wl_display_next_serial (display);
 
-          if (kbd)
-            {
-              struct wl_resource *kr = find_resource_for_surface (&kbd->resource_list, 
pointer->focus_surface);
-              if (kr)
-                {
-                  wl_keyboard_send_modifiers (kr,
-                                              serial,
-                                              kbd->modifier_state.mods_depressed,
-                                              kbd->modifier_state.mods_latched,
-                                              kbd->modifier_state.mods_locked,
-                                              kbd->modifier_state.group);
-                }
-            }
-
           meta_window_handle_enter (pointer->focus_surface->window,
                                     /* XXX -- can we reliably get a timestamp for setting focus? */
                                     clutter_get_current_event_time (),


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