Commit Graph

81 Commits

Author SHA1 Message Date
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
Marcel Hollerbach c1c58cfb69 efl_ui_focus_manager_calc: fix first touch setup for none regular tests
we had the issue that we stopped looping if we are a regular end. but we
need to continue until we have no rec_manager anymore.
2017-12-06 16:10:18 +01:00
Marcel Hollerbach 78afa2fb84 efl_ui_focus_user/object: fix api duplication
just like the commit before, this fixes duplicated api names
2017-12-05 17:19:28 +01:00
Marcel Hollerbach baf624680d efl_ui_focus_manager: fix api duplication 2017-12-05 17:19:28 +01:00
Chris Michael edc6ee8680 elementary: Remove set but unused variables
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-28 11:42:01 -05:00
Al Poole 75a450f2ba efl_ui_focus_manager: remove unnecessary debugging printf. 2017-11-22 16:11:12 +00:00
Marcel Hollerbach 9fc0cafde4 efl_ui_focus_manager: fixup previous commit
i forgot to git commit --amend ... i am sorry :[
2017-11-22 14:57:57 +01:00
Marcel Hollerbach 0f8e0e2324 efl_ui_focus_manager: try to error out instead of a infinit recusrion 2017-11-22 14:45:47 +01:00
Marcel Hollerbach 0d50783077 efl_ui_focus_manager: move preparing of the manager to its own api
with this some imlpementations can decide if they want to fallback to
some older focused item once they need to prepare themself for this
call.
2017-11-22 13:24:52 +01:00
Marcel Hollerbach e8cfdb5dcd efl_ui_focus_manager_calc: keep focus history arround
this now keeps items arround even if a explicit other widget was
focused. This is usefull if we have a few logical items on the focus
stack and you remove them.
2017-11-21 16:32:27 +01:00
Marcel Hollerbach 688e7001c1 efl_ui_focus_manager_calc: remove a logical item that caused a redirect
so we dont try to focus a logical item.
2017-11-21 16:32:27 +01:00
Marcel Hollerbach 67188ba22b efl_ui_focus_manager: emit callbacks after stack change
fix T6389
2017-11-20 09:13:08 +01:00
Pawel Aksiutowicz cb2ba05675 elementary: fix typos
Reviewers: stanluk, lukasz.stanislawski

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5494
2017-11-20 11:54:52 +09:00
Marcel Hollerbach 19cb57d914 efl_ui_focus_manager_calc: efl_wref_del deletes the wref
A happy thank you goes to the doc for leaving this trivial peace of
information undiscovered!

Followup commit will fix this
2017-11-17 16:08:14 +01:00
Marcel Hollerbach ffca5284ae efl_ui_focus_manager:do not followup if we have not changed candidate
_followup_previous_direction should only be called if there was a real
change to the redirect. In was happening that we have not changed the
focus but called _followup_previous_direction, which lead to weird focus
changes.
2017-11-17 16:08:14 +01:00
Marcel Hollerbach 4086f18ebf efl_ui_focus_manager_calc: error if a element is not registered yet 2017-11-17 16:08:14 +01:00
Marcel Hollerbach de084292e0 efl_ui_focus_manager: unset the redirect chain once a redirect is set
this prevents the manager from having a redirect chain while not even
beeing used by the root manager
2017-11-15 13:21:22 +01:00
Marcel Hollerbach 7e227161b9 efl_ui_focus_manager_calc: correct handle focus when redirects are set
so we dont have two focused elements
2017-11-15 13:21:22 +01:00
Marcel Hollerbach df81e2f492 efl_ui_focus_manager: ensure the manager is in focus when focus is set
this makes handling of focus easier in elementary
2017-11-15 13:21:22 +01:00
Marcel Hollerbach 07cb2d2dcd efl_ui_focus_object: document the bahaviour of the manager property 2017-11-15 13:21:22 +01:00
Pawel Aksiutowicz e2ad1469a5 focus: Some typos for efl_ui_focus_manager fixed
Reviewers: stanluk, lukasz.stanislawski

Subscribers: lukasz.stanislawski, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5433
2017-11-08 15:16:04 +09:00
Jean-Philippe Andre 6cea4993e0 elm: Don't do anything before construction
Obviously ui.win is still the ugly exception.
2017-11-07 14:43:22 +09:00
Chris Michael 5332f3355b efl-ui-focus-manager: Remove set but not used variable
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-02 10:05:56 -04:00
Marcel Hollerbach f2da8a7f54 efl_ui_focus_manager: remove strange naming of a function
this is just normal next or prev, the prepare is done on the caller side
now
2017-11-01 15:26:52 +01:00
Marcel Hollerbach 08d104498c efl_ui_focus_manager: improve debug informations 2017-11-01 15:26:52 +01:00
Marcel Hollerbach 1fcb357a66 efl_ui_focus_manager_calc: remove unused struct 2017-10-27 17:33:47 +02:00
Marcel Hollerbach 1c43f56fb9 efl_ui_focus_manager_calc: fix warnings 2017-10-27 17:33:04 +02:00
Marcel Hollerbach 5b8fbb7c69 efl_ui_focus_manager_calc: return last object when unfocusing last
this makes code easier, and fixes a bug where the wrong last element is
taken.
2017-10-27 17:08:08 +02:00
Marcel Hollerbach 1252b5ac29 efl_ui_focus_manager: correctly handle subitem directions in a redirect
in default focus just sets the focus to the first item in the redirect
manager, we now reset that back and move the focus to the last element
of a item.
2017-10-27 15:29:58 +02:00
Marcel Hollerbach acb469439f efl_ui_focus_manager: the FOCUSED event now carries the last focused
object

This is usefull to react on focused events
2017-10-27 12:06:40 +02:00
Marcel Hollerbach 3139b0f7f5 efl_ui_focus_manager: do not enter Nodes with redirects
we always want the redirect on the lowest level.
2017-10-27 12:06:40 +02:00
Marcel Hollerbach 3e726c364b efl_ui_focus_manager: reset when a redirect is unset
this keeps the history clear
2017-10-24 17:37:31 +02:00
Marcel Hollerbach f79b1b9826 efl_ui_focus_manager: new api
Can be used to fetch a focusable widget that has child as parent.
2017-10-20 17:21:57 +02:00