mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
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:
parent
ce9cc2db86
commit
7444a151b2
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user