forked from enlightenment/efl
Merge branch 'devs/iscaro/osx'
Some fixes for OS X. This series fixes two problems pointed by jayji and some other compiler warnings. Patches by iscaro. Differential Revision: https://phab.enlightenment.org/D4339
This commit is contained in:
commit
c8af4e498e
|
@ -409,7 +409,7 @@ main(int argc,
|
|||
if (!acc_)
|
||||
{
|
||||
acc_ = _my_account_new(argv[4]);
|
||||
eina_hash_direct_add(my_cache->accounts, acc_->name, acc);
|
||||
eina_hash_direct_add(my_cache->accounts, acc_->name, acc_);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "ERROR: account '%s' already exists.\n",
|
||||
|
|
|
@ -473,7 +473,7 @@ _ecore_direct_worker(Ecore_Pthread_Worker *work)
|
|||
static void
|
||||
_ecore_thread_worker_cleanup(void *data EINA_UNUSED)
|
||||
{
|
||||
DBG("cleanup thread=%" PRIu64 " (should join)", PHS());
|
||||
DBG("cleanup thread=%" PRIuPTR " (should join)", PHS());
|
||||
SLKL(_ecore_pending_job_threads_mutex);
|
||||
_ecore_thread_count--;
|
||||
SLKU(_ecore_pending_job_threads_mutex);
|
||||
|
|
|
@ -90,16 +90,17 @@ 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;
|
||||
|
||||
if (mod & NSEventModifierFlagShift) modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
|
||||
if (mod & NSEventModifierFlagShift) modifiers |= ECORE_EVENT_MODIFIER_CTRL;
|
||||
if (mod & NSEventModifierFlagControl) modifiers |= ECORE_EVENT_MODIFIER_CTRL;
|
||||
if (mod & NSEventModifierFlagOption) modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
|
||||
if (mod & NSEventModifierFlagOption) modifiers |= ECORE_EVENT_MODIFIER_WIN;
|
||||
if (mod & NSEventModifierFlagCommand) modifiers |= ECORE_EVENT_MODIFIER_WIN;
|
||||
if (mod & NSEventModifierFlagNumericPad) modifiers |= ECORE_EVENT_LOCK_NUM;
|
||||
if (mod & NSEventModifierFlagCapsLock) modifiers |= ECORE_EVENT_LOCK_CAPS;
|
||||
|
||||
DBG("key modifiers: 0x%lx, %u", mod, modifiers);
|
||||
return modifiers;
|
||||
|
@ -133,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];
|
||||
|
@ -246,14 +247,16 @@ _ecore_cocoa_feed_events(void *anEvent)
|
|||
// Turn special key flags on
|
||||
if (flags & NSEventModifierFlagShift)
|
||||
evDown->key = "Shift_L";
|
||||
else if (flags & NSEventModifierFlagShift)
|
||||
else if (flags & NSEventModifierFlagControl)
|
||||
evDown->key = "Control_L";
|
||||
else if (flags & NSEventModifierFlagOption)
|
||||
evDown->key = "Alt_L";
|
||||
else if (flags & NSEventModifierFlagOption)
|
||||
else if (flags & NSEventModifierFlagCommand)
|
||||
evDown->key = "Super_L";
|
||||
else if (flags & NSEventModifierFlagCapsLock)
|
||||
evDown->key = "Caps_Lock";
|
||||
else if (flags & NSEventModifierFlagNumericPad)
|
||||
evDown->key = "Num_Lock";
|
||||
|
||||
if (evDown->key)
|
||||
{
|
||||
|
@ -278,14 +281,16 @@ _ecore_cocoa_feed_events(void *anEvent)
|
|||
// Turn special key flags off
|
||||
if (changed_flags & NSEventModifierFlagShift)
|
||||
evUp->key = "Shift_L";
|
||||
else if (changed_flags & NSEventModifierFlagShift)
|
||||
else if (changed_flags & NSEventModifierFlagControl)
|
||||
evUp->key = "Control_L";
|
||||
else if (changed_flags & NSEventModifierFlagOption)
|
||||
evUp->key = "Alt_L";
|
||||
else if (changed_flags & NSEventModifierFlagOption)
|
||||
else if (changed_flags & NSEventModifierFlagCommand)
|
||||
evUp->key = "Super_L";
|
||||
else if (changed_flags & NSEventModifierFlagCapsLock)
|
||||
evUp->key = "Caps_Lock";
|
||||
else if (changed_flags & NSEventModifierFlagNumericPad)
|
||||
evUp->key = "Num_Lock";
|
||||
|
||||
if (evUp->key)
|
||||
{
|
||||
|
@ -329,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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -6147,6 +6147,9 @@ _efl_ui_win_teamwork_uri_open(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const ch
|
|||
zwp_teamwork_open_uri(ewd->wl.teamwork, ecore_wl2_window_surface_get(sd->wl.win), uri);
|
||||
}
|
||||
#endif
|
||||
#if !defined(HAVE_ELEMENTARY_WL2) && !defined(HAVE_ELEMENTARY_X)
|
||||
(void)sd;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* legacy APIs */
|
||||
|
|
|
@ -339,7 +339,7 @@ _ecore_evas_cocoa_free(Ecore_Evas *ee)
|
|||
{
|
||||
DBG("");
|
||||
ecore_evases = eina_list_remove(ecore_evases, ee);
|
||||
ecore_event_window_unregister(0);
|
||||
ecore_event_window_unregister(ee->prop.window);
|
||||
_ecore_evas_cocoa_shutdown();
|
||||
ecore_cocoa_shutdown();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue