summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-09-13 21:03:17 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-09-13 21:03:17 +0200
commite11f5b637b2eb516404406c1625e49ada0e00b38 (patch)
treee4ffd48f4c9f5b5253d7a87780cb8f1a973f9566
parent50149e95cdc04fea165009d164e45accc804f7d1 (diff)
downloadefl-devs/bu5hm4n/lets_fix_that.tar.gz
edje: make it handle late appearing of devicesdevs/bu5hm4n/lets_fix_that
device adds can happen late, which means evas does not know the default device until a time that is later than the focusing of some edje part. Which means that keystrokes etc. are lost for the parts beeing focused before the default device appeared. This should fix that. For the later people in this world: Watch out! someone decided to map seats in edje with a linear counter starting at 1, which means seat0<->seat1 seat1<->seat2 thanks for that riddle, i feel like i have beaten the sphinxs.
-rw-r--r--src/lib/edje/edje_load.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 03689c0f4e..f1f3a43610 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -603,10 +603,24 @@ _edje_device_add(Edje *ed, Efl_Input_Device *dev)
EINA_LIST_FOREACH(ed->seats, l, s)
{
- if (s->name != name)
- continue;
- seat = s;
- break;
+ //we have found a mathing seat!
+ if (s->name == name)
+ {
+ seat = s;
+ break;
+ }
+
+ /* s->name beeing NULL means someone setted before focus on a part,
+ * while no single seat was known to evas, this is some kind of
+ * broken state, and we should now claime those focus ed elements
+ * for us, since we are the first real seat
+ */
+ if (!s->name && eina_list_count(ed->seats) == 0)
+ {
+ seat = s;
+ s->name = name;
+ break;
+ }
}
if (!seat)