quartz: return modifiers instead of an event mask ...

This commit is contained in:
Kristian Rietveld 2011-07-25 22:26:52 +02:00
parent ceca333309
commit c9f6c7645c
4 changed files with 27 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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