From 186dd9b00e9c52521598385bc24c2b1fe961b9d5 Mon Sep 17 00:00:00 2001 From: Guilherme Iscaro Date: Sat, 8 Oct 2016 17:29:08 -0300 Subject: [PATCH] Ecore Cocoa: Add missing modifiers field to Ecore Events Fix T4477 --- src/lib/ecore_cocoa/ecore_cocoa.m | 8 ++++---- src/lib/ecore_cocoa/ecore_cocoa_private.h | 2 ++ src/lib/ecore_cocoa/ecore_cocoa_window.m | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m index 7400eb9..1c9c20f 100644 --- a/src/lib/ecore_cocoa/ecore_cocoa.m +++ b/src/lib/ecore_cocoa/ecore_cocoa.m @@ -90,8 +90,8 @@ ecore_cocoa_shutdown(void) return _ecore_cocoa_init_count; } -static unsigned int -_ecore_cocoa_event_modifiers(NSUInteger mod) +unsigned int +ecore_cocoa_event_modifiers(NSUInteger mod) { unsigned int modifiers = 0; @@ -134,7 +134,7 @@ _ecore_cocoa_event_key(NSEvent *event, } ev->timestamp = time; - ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]); + ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]); ev->keycode = event.keyCode; ev->string = [keycharRaw cStringUsingEncoding:NSUTF8StringEncoding]; @@ -334,7 +334,7 @@ _ecore_cocoa_feed_events(void *anEvent) ev->window = (Ecore_Window)window.ecore_window_data; ev->event_window = ev->window; - ev->modifiers = 0; /* FIXME: keep modifier around. */ + ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]); ev->timestamp = time; if (dy != 0) { diff --git a/src/lib/ecore_cocoa/ecore_cocoa_private.h b/src/lib/ecore_cocoa/ecore_cocoa_private.h index 478cadf..a97d278 100644 --- a/src/lib/ecore_cocoa/ecore_cocoa_private.h +++ b/src/lib/ecore_cocoa/ecore_cocoa_private.h @@ -79,6 +79,8 @@ Eina_Bool _ecore_cocoa_window_init(void); Eina_Bool _ecore_cocoa_feed_events(void *anEvent); +unsigned int ecore_cocoa_event_modifiers(NSUInteger mod); + #endif diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m index 126bf7f..249c0a8 100644 --- a/src/lib/ecore_cocoa/ecore_cocoa_window.m +++ b/src/lib/ecore_cocoa/ecore_cocoa_window.m @@ -215,6 +215,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST]; else ev->triple_click = 0; + ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]); ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL); } @@ -272,6 +273,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST]; else ev->triple_click = 0; + ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]); ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); } @@ -312,6 +314,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST]; ev->multi.x = ev->x; ev->multi.y = ev->y; + ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]); ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); } -- 2.7.4