[gtk+/gtk-3-2] quartz: include all buttons' states in GdkEventButton.state (cherry picked from commit a381e8ea62441
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-2] quartz: include all buttons' states in GdkEventButton.state (cherry picked from commit a381e8ea62441
- Date: Tue, 8 Nov 2011 23:27:35 +0000 (UTC)
commit e0d2525a526110fe3f0347b6af4d39a92bac4464
Author: Michael Natterer <mitch gimp org>
Date: Wed Nov 9 00:25:01 2011 +0100
quartz: include all buttons' states in GdkEventButton.state
(cherry picked from commit a381e8ea62441b6715ba9bcb0e04332fd914f8b1)
gdk/quartz/gdkevents-quartz.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 971098a..edf56fb 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -790,9 +790,9 @@ fill_button_event (GdkWindow *window,
{
GdkEventType type;
gint state;
- gint button;
- state = get_keyboard_modifiers_from_ns_event (nsevent);
+ state = get_keyboard_modifiers_from_ns_event (nsevent) |
+ _gdk_quartz_events_get_current_mouse_modifiers ();
switch ([nsevent type])
{
@@ -800,18 +800,19 @@ fill_button_event (GdkWindow *window,
case NSRightMouseDown:
case NSOtherMouseDown:
type = GDK_BUTTON_PRESS;
+ state &= ~get_mouse_button_modifiers_from_ns_event (nsevent);
break;
+
case NSLeftMouseUp:
case NSRightMouseUp:
case NSOtherMouseUp:
type = GDK_BUTTON_RELEASE;
state |= get_mouse_button_modifiers_from_ns_event (nsevent);
break;
+
default:
g_assert_not_reached ();
}
-
- button = get_mouse_button_from_ns_event (nsevent);
event->any.type = type;
event->button.window = window;
@@ -822,7 +823,7 @@ fill_button_event (GdkWindow *window,
event->button.y_root = y_root;
/* FIXME event->axes */
event->button.state = state;
- event->button.button = button;
+ event->button.button = get_mouse_button_from_ns_event (nsevent);
event->button.device = _gdk_display->core_pointer;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]