aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-10-18 20:56:26 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-18 21:01:56 +0900
commitdfd98b3e48a02c35fbbe14b709cbe72e65ea9500 (patch)
tree84cd1a64fbb285319d873aecdaabd6b43f30ccdb /src/lib/elementary/efl_ui_win.c
parentelm_scroller: fix scrolling with key move (diff)
downloadefl-dfd98b3e48a02c35fbbe14b709cbe72e65ea9500.tar.gz
win: Do not forward all key events on win (legacy)
OMG... I do not like this patch. See https://phab.enlightenment.org/T6148, two key down events are received when a key grab is installed on a Win object. This is because all input events are propagated from ecore all the way up to win and can be listened on. Unfortunately this breaks existing applications that use the key grab API properly to listen to key events. Another side effect is that ALL key events are received by the window, which means it's not limited to what the application expected (from its list of grabs). Solution (ugly): block propagation of key down/up events if the window is a legacy window. This means that no key grab is required for EO windows, but key grabs are still required for legacy windows. Fixes https://phab.enlightenment.org/T6148 @fix
Diffstat (limited to 'src/lib/elementary/efl_ui_win.c')
-rw-r--r--src/lib/elementary/efl_ui_win.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 17819923bb..111032a73c 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1935,12 +1935,16 @@ _win_event_add_cb(void *data, const Efl_Event *ev)
}
else if (array[i].desc == EFL_EVENT_KEY_DOWN)
{
+ // Legacy API: Must grab key
+ if (elm_widget_is_legacy(win)) return;
if (!(sd->event_forward.key_down++))
efl_event_callback_add(sd->evas, array[i].desc,
_evas_event_key_cb, win);
}
else if (array[i].desc == EFL_EVENT_KEY_UP)
{
+ // Legacy API: Must grab key
+ if (elm_widget_is_legacy(win)) return;
if (!(sd->event_forward.key_up++))
efl_event_callback_add(sd->evas, array[i].desc,
_evas_event_key_cb, win);
@@ -2062,12 +2066,16 @@ _win_event_del_cb(void *data, const Efl_Event *ev)
}
else if (array[i].desc == EFL_EVENT_KEY_DOWN)
{
+ // Legacy API: Must grab key
+ if (elm_widget_is_legacy(win)) return;
if (!(--sd->event_forward.key_down))
efl_event_callback_del(sd->evas, array[i].desc,
_evas_event_key_cb, win);
}
else if (array[i].desc == EFL_EVENT_KEY_UP)
{
+ // Legacy API: Must grab key
+ if (elm_widget_is_legacy(win)) return;
if (!(--sd->event_forward.key_up))
efl_event_callback_del(sd->evas, array[i].desc,
_evas_event_key_cb, win);