mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
xdg,xwayland: raise sub-view correctly relative to other sub-views
When a parent view has multiple sub-views (dialogs) visible, focusing one sub-view ought to raise it above the others. This doesn't currently happen -- focusing a sub-view raises the whole group of views together, but has no effect on the relative stacking order between them. This seems like a simple oversight in xdg/xwayland_view_move_to_front() that's pretty easy to fix. Add FIXMEs to deduplicate this logic in future. Tested with HomeBank: the Import dialog pops up an additional Open File dialog, which before this change appears behind the Import dialog (and clicking on it does not raise it to the front). After this change, the Open File dialog appears in front as expected.
This commit is contained in:
parent
8e2ec3437b
commit
a047e4a4e3
2 changed files with 12 additions and 0 deletions
|
|
@ -349,14 +349,20 @@ static void
|
|||
xdg_toplevel_view_move_to_front(struct view *view)
|
||||
{
|
||||
struct view *root = xdg_toplevel_view_get_root(view);
|
||||
/* FIXME: this exact code is repeated in xwayland.c */
|
||||
view_impl_move_to_front(root);
|
||||
view_impl_move_sub_views(root, LAB_TO_FRONT);
|
||||
/* make sure view is in front of other sub-views */
|
||||
if (view != root) {
|
||||
view_impl_move_to_front(view);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_toplevel_view_move_to_back(struct view *view)
|
||||
{
|
||||
struct view *root = xdg_toplevel_view_get_root(view);
|
||||
/* FIXME: this exact code is repeated in xwayland.c */
|
||||
view_impl_move_sub_views(root, LAB_TO_BACK);
|
||||
view_impl_move_to_back(root);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -614,14 +614,20 @@ static void
|
|||
xwayland_view_move_to_front(struct view *view)
|
||||
{
|
||||
struct view *root = xwayland_view_get_root(view);
|
||||
/* FIXME: this exact code is repeated in xdg.c */
|
||||
view_impl_move_to_front(root);
|
||||
view_impl_move_sub_views(root, LAB_TO_FRONT);
|
||||
/* make sure view is in front of other sub-views */
|
||||
if (view != root) {
|
||||
view_impl_move_to_front(view);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
xwayland_view_move_to_back(struct view *view)
|
||||
{
|
||||
struct view *root = xwayland_view_get_root(view);
|
||||
/* FIXME: this exact code is repeated in xdg.c */
|
||||
view_impl_move_sub_views(root, LAB_TO_BACK);
|
||||
view_impl_move_to_back(root);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue