Commit Graph

113 Commits

Author SHA1 Message Date
Marcel Hollerbach 69c2e6f0e6 efl_ui_focus_manager: unset redirect instead of wrefing it
so focus is restored correctly
2018-05-08 11:50:04 +02:00
Marcel Hollerbach fa9aff8f70 efl_ui_focus_manager_calc: do not restore focus when redirect is set
When there is a redirect there is no need to adjust the focus property
based on a unregister, so just continue and cleanup the history. When
the redirect is unset the focus is restored.

fix T6908
2018-05-08 11:50:04 +02:00
Mike Blumenkrantz da13878cc2 efl_ui_focus_manager_calc: resolve shadow warning
Summary:
lib/elementary/efl_ui_focus_manager_calc.c: In function ‘node_item_free’:
lib/elementary/efl_ui_focus_manager_calc.c:208:20: warning: declaration of ‘n’ shadows a previous local [-Wshadow]
         Eina_List *n;
                    ^
lib/elementary/efl_ui_focus_manager_calc.c:197:10: note: shadowed declaration is here
    Node *n;
          ^

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6020
2018-05-03 16:13:30 -04:00
Marcel Hollerbach d1a89cfd9d efl_ui_focus_manager_calc: partly revert 3571b35a30
And document why this must be, so the same error is not done again :)

fix T6908
2018-05-01 20:27:07 +02:00
Marcel Hollerbach dc57abfafd efl_ui_focus_manager: remove partners field 2018-05-01 20:27:07 +02:00
Marcel Hollerbach 258b96be35 efl_ui_focus: move graph calculation to seperated file 2018-05-01 20:27:07 +02:00
Marcel Hollerbach 9669ca9ab9 efl_ui_focus_manager_calc: prepare the tree when we attempt to move 2018-05-01 20:27:07 +02:00
Marcel Hollerbach 27d6f3a65d efl_ui_focus_util: add new function for complementing the direction 2018-04-30 19:24:47 +02:00
Marcel Hollerbach 3571b35a30 efl_ui_focus_manager_calc: drop redirect if there is no candidate 2018-04-30 15:22:52 +02:00
Marcel Hollerbach bd9b112094 efl_ui_focus_manager_calc: make the preparation call tree style
So we make sure that all children are prepared.
2018-04-30 15:22:52 +02:00
Xavi Artigas 55bd097a3d Efl.Gfx.Entity (from Efl.Gfx)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:32 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Marcel Hollerbach 803fddea5d efl_ui_focus_manager_calc: do not redirect requested calls
this is not documented and does not make sense.
2018-04-13 11:07:34 +02:00
YeongJong Lee 35e7b36411 efl_ui_focus_manager_calc: a node from focus_stack is always normal node.
Summary:
focus_stack can't store logical node. we don't need to check a node from
focus_stack is not normal.
see line 1613

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5927
2018-04-13 11:07:34 +02:00
YeongJong Lee 4841165530 efl_ui_focus_manager_calc: remove needless check for normal node
Summary:
a node in focus stack is always normal node. we don't need to check whether
node is normal.

see also, 97ec48434f

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5930
2018-04-13 11:07:34 +02:00
Marcel Hollerbach 01272c71d0 efl_ui_focus_manager: make request_move more powerfull
it turns out that it is useful and needed (for future patches) to
request moves for nodes that are not focused currently. It is also
needed to request a move that might end up in a logical node.
2018-04-13 11:07:33 +02:00
Marcel Hollerbach 32e17ecdc2 efl_ui_focus_manager_calc: only call next when the node is unexpected
ref T6793
2018-04-13 11:07:33 +02:00
Marcel Hollerbach 253430ab76 efl_ui_focus_manager_calc: call next after requesting a subchild
requesting subchild for subchild is not a good idea, as it really only
fetches for a subchild, and never calls next and escapes the children of
the passed node.

fix T6793
2018-04-11 17:16:34 +02:00
Marcel Hollerbach 84ad5d9fe3 introduce efl_ui_focus_manager_window_root
Which is a interface that indicates that this is the root of all focus
managers.
2018-04-09 18:05:27 +02:00
Marcel Hollerbach 39739ba333 efl_ui_focus_manager_calc: node depth is 0 for a NULL object 2018-04-04 10:11:22 +02:00
Marcel Hollerbach 7fe52c55cf efl_ui_focus_manager_calc: fix infinite loop in _request_subchild
When the subchild where we request subchilds from was regular, the while
loop would have run infinitly. This is now fixed by at least calling
once _next, the check to not run outside the node is now done with
calculating the depth of the nodes.
2018-04-03 14:08:28 +02:00
Marcel Hollerbach 28201f32a6 efl_ui_focus_manager_calc: do not crash for the case of a invalid child 2018-03-28 10:48:01 +02:00
Marcel Hollerbach b23c2b34e3 efl_ui_focus_manager: NULL out fields correctly 2018-03-28 10:48:01 +02:00
Marcel Hollerbach ca2461c280 efl_ui_focus_manager: move cleanup into one place
ref T6793
2018-03-28 10:48:01 +02:00
Marcel Hollerbach c8ba7a070f efl_ui_focus_manager_calc: set redirect before setting focus
settings the redirect might result in unfocus calls, that might unset
evas_object_focus on a object that might be registered in two managers
due to border linking. This fixes mysterical disapearing focus.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach 875a7eb0da efl_ui_focus_manager_calc: do not set focus on a deletion manager
otherwise objects might already be on the way out, without a elementary
parent.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach 844854d3e8 efl_ui_focus_manager_calc: add onedirection to dirty 2018-03-15 15:39:12 +01:00
Marcel Hollerbach 253680f754 efl_ui_focus_manager_calc: performe refocus after the node is deleted
if node is the last element, the element will be focused again, and
later deleted, without cleaning up the history
2018-03-07 19:27:12 +09:00
Marcel Hollerbach d9ae0657e8 efl_ui_focus_manager: do not call on a NULL object 2018-02-20 16:48:42 +01:00
Marcel Hollerbach ea6a4e1a60 efl_ui_focus_manager_calc: unset manager to make touching sure
when there is only one object in a manager, and this object has a
redirect manager, then right now nothing will happen and nothing will be
called on the redirect manager.

With this patch the redirect manager will be unset when the manager
cannot give a correct candidate.
2018-02-20 16:48:42 +01:00
Yeongjong Lee e031867354 efl_ui_focus_manager_calc: fallback to use root if the focus stack is empty
Summary: this patch fixes T6664

Test Plan:
1. elementary_test -to focus
2. click Disable button
3. check whether you can move focus using key event.

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric

Maniphest Tasks: T6664

Differential Revision: https://phab.enlightenment.org/D5813
2018-02-20 16:48:42 +01:00
YeongJong Lee f6777aa4ac efl_ui_focus_manager_calc: search redirect_entry if there is no candidate
Summary:
redirect is out of the focus stack. we need to find redirect_entry after last
node of redirect manager instead of focus stack.

Test Plan:
1. elementary_test -to focus
2. move focus using tab key
3. check that there is focus cycle

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5811
2018-02-20 16:48:42 +01:00
Marcel Hollerbach 97ec48434f efl_ui_focus_manager_calc: keep the entry for the redirect seperated
logicals on the focus stack can cause there a lot of confusion.

This fixes a missed focus out event from the entry in elementary_test
2018-01-27 13:01:20 +01:00
Marcel Hollerbach 7d0008d6e2 efl_ui_focus_manager_calc: prepare everything before border elem eval
otherwise we might miss the elements that are registered on prepare.
2018-01-26 15:11:50 +01:00
Marcel Hollerbach 1be0506b31 efl_ui_focus_manager_calc: check earlier for LOGICAL
this safes us performance
2018-01-26 15:11:50 +01:00
Marcel Hollerbach 8d1b9d4f9e efl_ui_focus_manager: listen to deletion for regular and logical
otherwise we might exit with a load of errors
2018-01-23 21:27:45 +01:00
Marcel Hollerbach 5b64079ee9 efl_ui_focus_manager: fix infinit loop in enlightenment wizard
we unsetted and setted focus_manager once too often, so we ended up in a
infinite loop. This should be fixed now. Sorry Derek!
2018-01-16 23:22:01 +01:00
Yeongjong Lee 210db8fc5d efl_ui_focus: merge efl_ui_focus_user and efl_ui_focus_object into one mixin
Summary:
focus_user and focus_object are similar classes. by merging them into
one mixin, we can maintain consistency.

Test Plan: make check

Reviewers: bu5hm4n

Subscribers: cedric, Jaehyun_Cho, woohyun, jpeg

Differential Revision: https://phab.enlightenment.org/D5734
2018-01-16 22:39:13 +01:00
Jean-Philippe Andre a92186be6a ecore/edje/elm: Fix a few WRN from calls to NULL
This fixes some of the warnings generated by calling functions on NULL
objects. One of the main remaining points is to avoid unwanted warnings
on non-existing parts.

Ref T6326
2018-01-16 18:37:05 +09:00
YeongJong Lee 1b4f330c9c efl_ui_focus_manager_calc: store node data before the node is freed
Summary:
we can consider that the node is freed during focus_manager routine.
for example, efl_ui_focus_manager_redirect_set call edje event callbacks,
and a application can delete a object in the edje callback. if the object is
the focusable object of a node, focus_manager make the node freed.
the focus_manager is able to use freed node. (a good example is test_popup.c)

this prevent reusing freed pointers.

Test Plan:
1. elementary_test -to popup
2. popup-center-text + 1 button
3. Click the Close button
4. check that there is no erroe message

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric, woohyun, jpeg, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5729
2018-01-11 09:51:59 +01:00
Cedric BAIL 526415d903 eo: make efl_provider_find a @const function. 2018-01-04 11:45:10 -08:00
Marcel Hollerbach f05249f30b efl_ui_focus_manager_calc: dont use sqrt
We only need the order, not the exact value
2017-12-15 11:31:25 +01:00
Marcel Hollerbach f1a2e0f439 efl_ui_focus_manager_calc: use pow instead of powerof2 2017-12-15 11:31:25 +01:00
Marcel Hollerbach 685fb33d86 efl_ui_focus_manager_calc: move the second stage result to another list
holding them in the same list is a problem due to the fact that a member
B in partners of A means that there also needs to be A in the partners
of A. Due to this fact the cleanup logic before missed a few nodes and
crashed in some cases. This is now fixed.
2017-12-12 12:51:03 +01:00
Marcel Hollerbach b4e21d7f4f efl_ui_focus_manager: this thing is not used anymore 2017-12-11 10:46:52 +01:00
Marcel Hollerbach c3a4fc7d64 efl_ui_focus_manager_calc: performe the second stage later
the second stage is not meant to be a transition in both ways, only
because the one item is closer does not mean a other one is closer.
2017-12-11 10:46:52 +01:00
Marcel Hollerbach 87cc19b94d efl_ui_focus_manager_calc: implement better relation calculation
The new calculation mechanism does not only look into the exact
directions up,right,down,left of a node, it also now checks the sectors,
bound by: x < node.x, x > node.max_x, y < node.y, y > node.max_y.

ref T6453
2017-12-11 10:46:52 +01:00
Marcel Hollerbach 22c7fb86d9 efl_ui_focus_manager_calc: refactor into its own stage 2017-12-11 10:46:52 +01:00
Marcel Hollerbach 44d7ff1fb3 efl_ui_focus_manager_calc: refactor calculation logic 2017-12-11 10:46:52 +01:00
Marcel Hollerbach eee6fbad78 focus: more testcases! 2017-12-06 16:10:18 +01:00