[gtk/wip/chergert/gdk-macos-gl-renderer] macos: use gdk_surface_request_motion()



commit fb7b53d0e8027c7dcf71df00f30c3fc1e1c4de6c
Author: Christian Hergert <chergert redhat com>
Date:   Wed Nov 4 16:40:45 2020 -0800

    macos: use gdk_surface_request_motion()
    
    We don't need our own helper for this anymore.

 gdk/macos/gdkmacosdisplay-private.h   |  2 --
 gdk/macos/gdkmacosdisplay-translate.c | 40 -----------------------------------
 gdk/macos/gdkmacosdisplay.c           |  2 +-
 3 files changed, 1 insertion(+), 43 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdisplay-private.h b/gdk/macos/gdkmacosdisplay-private.h
index 9f45a2e200..630daceae0 100644
--- a/gdk/macos/gdkmacosdisplay-private.h
+++ b/gdk/macos/gdkmacosdisplay-private.h
@@ -136,8 +136,6 @@ void             _gdk_macos_display_add_frame_callback             (GdkMacosDisp
                                                                     GdkMacosSurface *surface);
 void             _gdk_macos_display_remove_frame_callback          (GdkMacosDisplay *self,
                                                                     GdkMacosSurface *surface);
-void             _gdk_macos_display_synthesize_motion              (GdkMacosDisplay *self,
-                                                                    GdkMacosSurface *surface);
 NSWindow        *_gdk_macos_display_find_native_under_pointer      (GdkMacosDisplay *self,
                                                                     int             *x,
                                                                     int             *y);
diff --git a/gdk/macos/gdkmacosdisplay-translate.c b/gdk/macos/gdkmacosdisplay-translate.c
index 849d433634..76029314a8 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -253,46 +253,6 @@ fill_button_event (GdkMacosDisplay *display,
                                NULL);
 }
 
-static GdkEvent *
-synthesize_crossing_event (GdkMacosDisplay *display,
-                           GdkMacosSurface *surface,
-                           NSEvent         *nsevent,
-                           int              x,
-                           int              y)
-{
-  GdkEventType event_type;
-  GdkModifierType state;
-  GdkSeat *seat;
-
-  switch ((int)[nsevent type])
-    {
-    case NSEventTypeMouseEntered:
-      event_type = GDK_ENTER_NOTIFY;
-      break;
-
-    case NSEventTypeMouseExited:
-      event_type = GDK_LEAVE_NOTIFY;
-      break;
-
-    default:
-      g_return_val_if_reached (NULL);
-    }
-
-  state = get_keyboard_modifiers_from_ns_event (nsevent) |
-         _gdk_macos_display_get_current_mouse_modifiers (display);
-  seat = gdk_display_get_default_seat (GDK_DISPLAY (display));
-
-  return gdk_crossing_event_new (event_type,
-                                 GDK_SURFACE (surface),
-                                 gdk_seat_get_pointer (seat),
-                                 get_time_from_ns_event (nsevent),
-                                 state,
-                                 x,
-                                 y,
-                                 GDK_CROSSING_NORMAL,
-                                 GDK_NOTIFY_NONLINEAR);
-}
-
 static inline guint
 get_group_from_ns_event (NSEvent *nsevent)
 {
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c
index 665a567e70..f042b4a358 100644
--- a/gdk/macos/gdkmacosdisplay.c
+++ b/gdk/macos/gdkmacosdisplay.c
@@ -512,7 +512,7 @@ _gdk_macos_display_surface_became_key (GdkMacosDisplay *self,
    * ("is not key").  We send a dummy motion notify event now, so that
    * everything in the window is set to correct state.
    */
-  _gdk_macos_display_synthesize_motion (self, surface);
+  gdk_surface_request_motion (surface);
 }
 
 void


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