diff --git a/gdk/quartz/gdkdevice-core-quartz.c b/gdk/quartz/gdkdevice-core-quartz.c index 2f8781cde5..ff90c4a595 100644 --- a/gdk/quartz/gdkdevice-core-quartz.c +++ b/gdk/quartz/gdkdevice-core-quartz.c @@ -214,7 +214,8 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window, toplevel = gdk_window_get_effective_toplevel (window); if (mask) - *mask = _gdk_quartz_events_get_current_event_mask (); + *mask = _gdk_quartz_events_get_current_keyboard_modifiers () | + _gdk_quartz_events_get_current_mouse_modifiers (); /* Get the y coordinate, needs to be flipped. */ if (window == _gdk_root) @@ -358,7 +359,8 @@ gdk_quartz_device_core_window_at_position (GdkDevice *device, *win_y = found_window ? y_tmp : -1; if (mask) - *mask = _gdk_quartz_events_get_current_event_mask (); + *mask = _gdk_quartz_events_get_current_keyboard_modifiers () | + _gdk_quartz_events_get_current_mouse_modifiers (); return found_window; } diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index c611c0a106..d81f6f3002 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -49,8 +49,10 @@ static GdkWindow *current_keyboard_window; /* This is the event mask and button state from the last event */ -static GdkEventMask current_event_mask; -static int current_button_state; +static GdkEventMask current_event_mask; +static GdkModifierType current_keyboard_modifiers; +static GdkModifierType current_mouse_modifiers; +static int current_button_state; static void append_event (GdkEvent *event, gboolean windowing); @@ -1064,6 +1066,18 @@ _gdk_quartz_events_get_current_event_mask (void) return current_event_mask; } +GdkModifierType +_gdk_quartz_events_get_current_keyboard_modifiers (void) +{ + return current_keyboard_modifiers; +} + +GdkModifierType +_gdk_quartz_events_get_current_mouse_modifiers (void) +{ + return current_mouse_modifiers; +} + static gboolean gdk_event_translate (GdkEvent *event, NSEvent *nsevent) @@ -1197,6 +1211,8 @@ gdk_event_translate (GdkEvent *event, } current_event_mask = get_event_mask_from_ns_event (nsevent); + current_keyboard_modifiers = get_keyboard_modifiers_from_ns_event (nsevent); + current_mouse_modifiers = get_mouse_button_modifiers_from_ns_event (nsevent); return_val = TRUE; diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h index 6a05e2501b..8b89a67644 100644 --- a/gdk/quartz/gdkprivate-quartz.h +++ b/gdk/quartz/gdkprivate-quartz.h @@ -64,6 +64,9 @@ void _gdk_quartz_events_update_focus_window (GdkWindow *new_window, void _gdk_quartz_events_send_map_event (GdkWindow *window); GdkEventMask _gdk_quartz_events_get_current_event_mask (void); +GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void); +GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void); + void _gdk_quartz_events_send_enter_notify_event (GdkWindow *window); /* Event loop */ diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index 3b7c5e3ae3..9bd104dfba 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -1836,7 +1836,8 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window, toplevel = gdk_window_get_toplevel (window); - *mask = _gdk_quartz_events_get_current_event_mask (); + *mask = _gdk_quartz_events_get_current_keyboard_modifiers () | + _gdk_quartz_events_get_current_mouse_modifiers (); /* Get the y coordinate, needs to be flipped. */ if (window == _gdk_root)