summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-10-08 17:29:08 -0300
committerGuilherme Iscaro <iscaro@profusion.mobi>2016-10-10 14:20:47 -0300
commit186dd9b00e9c52521598385bc24c2b1fe961b9d5 (patch)
treefdcd8e490d622520b14a3304674bf807bfc660c0 /src/lib/ecore_cocoa
parent0897715c8da0428331c9288bcef55e5fe53638b1 (diff)
Ecore Cocoa: Add missing modifiers field to Ecore Events
Fix T4477
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa.m8
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_private.h2
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_window.m3
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 7400eb9cbb..1c9c20f358 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)
90 return _ecore_cocoa_init_count; 90 return _ecore_cocoa_init_count;
91} 91}
92 92
93static unsigned int 93unsigned int
94_ecore_cocoa_event_modifiers(NSUInteger mod) 94ecore_cocoa_event_modifiers(NSUInteger mod)
95{ 95{
96 unsigned int modifiers = 0; 96 unsigned int modifiers = 0;
97 97
@@ -134,7 +134,7 @@ _ecore_cocoa_event_key(NSEvent *event,
134 } 134 }
135 135
136 ev->timestamp = time; 136 ev->timestamp = time;
137 ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]); 137 ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
138 138
139 ev->keycode = event.keyCode; 139 ev->keycode = event.keyCode;
140 ev->string = [keycharRaw cStringUsingEncoding:NSUTF8StringEncoding]; 140 ev->string = [keycharRaw cStringUsingEncoding:NSUTF8StringEncoding];
@@ -334,7 +334,7 @@ _ecore_cocoa_feed_events(void *anEvent)
334 334
335 ev->window = (Ecore_Window)window.ecore_window_data; 335 ev->window = (Ecore_Window)window.ecore_window_data;
336 ev->event_window = ev->window; 336 ev->event_window = ev->window;
337 ev->modifiers = 0; /* FIXME: keep modifier around. */ 337 ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
338 ev->timestamp = time; 338 ev->timestamp = time;
339 if (dy != 0) 339 if (dy != 0)
340 { 340 {
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_private.h b/src/lib/ecore_cocoa/ecore_cocoa_private.h
index 478cadf57d..a97d278e88 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);
79 79
80Eina_Bool _ecore_cocoa_feed_events(void *anEvent); 80Eina_Bool _ecore_cocoa_feed_events(void *anEvent);
81 81
82unsigned int ecore_cocoa_event_modifiers(NSUInteger mod);
83
82 84
83 85
84#endif 86#endif
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_window.m b/src/lib/ecore_cocoa/ecore_cocoa_window.m
index 126bf7fcea..249c0a8051 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];
215 else 215 else
216 ev->triple_click = 0; 216 ev->triple_click = 0;
217 217
218 ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
218 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL); 219 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
219} 220}
220 221
@@ -272,6 +273,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
272 else 273 else
273 ev->triple_click = 0; 274 ev->triple_click = 0;
274 275
276 ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
275 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); 277 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
276} 278}
277 279
@@ -312,6 +314,7 @@ static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
312 ev->multi.x = ev->x; 314 ev->multi.x = ev->x;
313 ev->multi.y = ev->y; 315 ev->multi.y = ev->y;
314 316
317 ev->modifiers = ecore_cocoa_event_modifiers([event modifierFlags]);
315 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); 318 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
316} 319}
317 320