[gtk/wip/chergert/gdk-macos-gl-renderer: 3/3] macos: remove synthesize_motion helper
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gdk-macos-gl-renderer: 3/3] macos: remove synthesize_motion helper
- Date: Thu, 5 Nov 2020 00:56:40 +0000 (UTC)
commit 7444a151b2da7b71a88cff25589cf1bdcf3973bf
Author: Christian Hergert <chergert redhat com>
Date: Wed Nov 4 16:58:50 2020 -0800
macos: remove synthesize_motion helper
We can use gdk_surface_request_motion() now instead of our extra
helper to do essentially the same thing.
gdk/macos/gdkmacosdisplay-private.h | 2 --
gdk/macos/gdkmacosdisplay-translate.c | 35 -----------------------------------
gdk/macos/gdkmacosdisplay.c | 2 +-
3 files changed, 1 insertion(+), 38 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..f895db9686 100644
--- a/gdk/macos/gdkmacosdisplay-translate.c
+++ b/gdk/macos/gdkmacosdisplay-translate.c
@@ -1155,41 +1155,6 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
return ret;
}
-void
-_gdk_macos_display_synthesize_motion (GdkMacosDisplay *self,
- GdkMacosSurface *surface)
-{
- GdkModifierType state;
- GdkEvent *event;
- GdkSeat *seat;
- NSPoint point;
- GList *node;
- int x;
- int y;
-
- g_return_if_fail (GDK_IS_MACOS_DISPLAY (self));
- g_return_if_fail (GDK_IS_MACOS_SURFACE (surface));
-
- seat = gdk_display_get_default_seat (GDK_DISPLAY (self));
- point = [NSEvent mouseLocation];
- _gdk_macos_display_from_display_coords (self, point.x, point.y, &x, &y);
-
- state = _gdk_macos_display_get_current_keyboard_modifiers (self) |
- _gdk_macos_display_get_current_mouse_modifiers (self);
-
- event = gdk_motion_event_new (GDK_SURFACE (surface),
- gdk_seat_get_pointer (seat),
- NULL,
- get_time_from_ns_event ([NSApp currentEvent]),
- state,
- x,
- y,
- NULL);
- node = _gdk_event_queue_append (GDK_DISPLAY (self), event);
- _gdk_windowing_got_event (GDK_DISPLAY (self), node, event,
- _gdk_display_get_next_serial (GDK_DISPLAY (self)));
-}
-
void
_gdk_macos_display_send_button_event (GdkMacosDisplay *self,
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]