macos: remove synthesize_motion helper

We can use gdk_surface_request_motion() now instead of our extra
helper to do essentially the same thing.
This commit is contained in:
Christian Hergert 2020-11-04 16:58:50 -08:00
parent ce9cc2db86
commit 7444a151b2
3 changed files with 1 additions and 38 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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