summaryrefslogtreecommitdiff
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
parent80a5297ae4bee5d1ed9a44c62cf5486b5220e1d9 (diff)
win: Do not forward all key events on win (legacy)
OMG... I do not like this patch. See 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 T6148 @fix
-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)
1935 } 1935 }
1936 else if (array[i].desc == EFL_EVENT_KEY_DOWN) 1936 else if (array[i].desc == EFL_EVENT_KEY_DOWN)
1937 { 1937 {
1938 // Legacy API: Must grab key
1939 if (elm_widget_is_legacy(win)) return;
1938 if (!(sd->event_forward.key_down++)) 1940 if (!(sd->event_forward.key_down++))
1939 efl_event_callback_add(sd->evas, array[i].desc, 1941 efl_event_callback_add(sd->evas, array[i].desc,
1940 _evas_event_key_cb, win); 1942 _evas_event_key_cb, win);
1941 } 1943 }
1942 else if (array[i].desc == EFL_EVENT_KEY_UP) 1944 else if (array[i].desc == EFL_EVENT_KEY_UP)
1943 { 1945 {
1946 // Legacy API: Must grab key
1947 if (elm_widget_is_legacy(win)) return;
1944 if (!(sd->event_forward.key_up++)) 1948 if (!(sd->event_forward.key_up++))
1945 efl_event_callback_add(sd->evas, array[i].desc, 1949 efl_event_callback_add(sd->evas, array[i].desc,
1946 _evas_event_key_cb, win); 1950 _evas_event_key_cb, win);
@@ -2062,12 +2066,16 @@ _win_event_del_cb(void *data, const Efl_Event *ev)
2062 } 2066 }
2063 else if (array[i].desc == EFL_EVENT_KEY_DOWN) 2067 else if (array[i].desc == EFL_EVENT_KEY_DOWN)
2064 { 2068 {
2069 // Legacy API: Must grab key
2070 if (elm_widget_is_legacy(win)) return;
2065 if (!(--sd->event_forward.key_down)) 2071 if (!(--sd->event_forward.key_down))
2066 efl_event_callback_del(sd->evas, array[i].desc, 2072 efl_event_callback_del(sd->evas, array[i].desc,
2067 _evas_event_key_cb, win); 2073 _evas_event_key_cb, win);
2068 } 2074 }
2069 else if (array[i].desc == EFL_EVENT_KEY_UP) 2075 else if (array[i].desc == EFL_EVENT_KEY_UP)
2070 { 2076 {
2077 // Legacy API: Must grab key
2078 if (elm_widget_is_legacy(win)) return;
2071 if (!(--sd->event_forward.key_up)) 2079 if (!(--sd->event_forward.key_up))
2072 efl_event_callback_del(sd->evas, array[i].desc, 2080 efl_event_callback_del(sd->evas, array[i].desc,
2073 _evas_event_key_cb, win); 2081 _evas_event_key_cb, win);