mirror of
https://github.com/labwc/labwc.git
synced 2026-03-19 05:33:53 -04:00
view: avoid restacking when view (or a sub-view) is already in front
Currently, every click within a sub-view results in first restacking
the parent view in front, and then the sub-view. This is unnecessary
and has caused issues in the past, such as with Xaw popups (which
we've worked around in d748dc78bc by adding an xcb_flush()).
It would be better not to do the unnecessary restacking at all.
This commit is contained in:
parent
ee7376421c
commit
2a96c4cdaf
1 changed files with 12 additions and 0 deletions
12
src/view.c
12
src/view.c
|
|
@ -2232,6 +2232,18 @@ void
|
||||||
view_move_to_front(struct view *view)
|
view_move_to_front(struct view *view)
|
||||||
{
|
{
|
||||||
assert(view);
|
assert(view);
|
||||||
|
struct server *server = view->server;
|
||||||
|
assert(!wl_list_empty(&server->views));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check whether the view is already in front, or is the root
|
||||||
|
* parent of the view in front (in which case we don't want to
|
||||||
|
* raise it in front of its sub-view).
|
||||||
|
*/
|
||||||
|
struct view *front = wl_container_of(server->views.next, front, link);
|
||||||
|
if (view == front || view == view_get_root(front)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct view *root = view_get_root(view);
|
struct view *root = view_get_root(view);
|
||||||
assert(root);
|
assert(root);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue