mirror of
https://github.com/labwc/labwc.git
synced 2026-04-11 08:21:13 -04:00
parent
4dc99e2f38
commit
28e52e079c
2 changed files with 32 additions and 0 deletions
|
|
@ -363,6 +363,7 @@ void desktop_move_to_front(struct view *view);
|
||||||
void desktop_move_to_back(struct view *view);
|
void desktop_move_to_back(struct view *view);
|
||||||
void desktop_focus_and_activate_view(struct seat *seat, struct view *view);
|
void desktop_focus_and_activate_view(struct seat *seat, struct view *view);
|
||||||
void desktop_arrange_all_views(struct server *server);
|
void desktop_arrange_all_views(struct server *server);
|
||||||
|
void desktop_toggle(struct server *server);
|
||||||
|
|
||||||
enum lab_cycle_dir {
|
enum lab_cycle_dir {
|
||||||
LAB_CYCLE_DIR_NONE,
|
LAB_CYCLE_DIR_NONE,
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ move_to_front(struct view *view)
|
||||||
wlr_scene_node_raise_to_top(&view->scene_tree->node);
|
wlr_scene_node_raise_to_top(&view->scene_tree->node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void desktop_hide_windows(struct server *server, bool hide);
|
||||||
|
|
||||||
void
|
void
|
||||||
desktop_move_to_front(struct view *view)
|
desktop_move_to_front(struct view *view)
|
||||||
{
|
{
|
||||||
|
|
@ -30,6 +32,7 @@ desktop_move_to_front(struct view *view)
|
||||||
#if HAVE_XWAYLAND
|
#if HAVE_XWAYLAND
|
||||||
xwayland_move_sub_views_to_front(view, move_to_front);
|
xwayland_move_sub_views_to_front(view, move_to_front);
|
||||||
#endif
|
#endif
|
||||||
|
desktop_hide_windows(view->server, false);
|
||||||
cursor_update_focus(view->server);
|
cursor_update_focus(view->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,6 +102,34 @@ desktop_focus_and_activate_view(struct seat *seat, struct view *view)
|
||||||
seat_focus_surface(seat, view->surface);
|
seat_focus_surface(seat, view->surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
desktop_hide_windows(struct server *server, bool hide)
|
||||||
|
{
|
||||||
|
struct wlr_scene_node *view_tree, *view_tree_on_top;
|
||||||
|
view_tree = &server->view_tree->node;
|
||||||
|
view_tree_on_top = &server->view_tree_always_on_top->node;
|
||||||
|
|
||||||
|
if (hide == !view_tree->enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hide) {
|
||||||
|
wlr_scene_node_set_enabled(view_tree, false);
|
||||||
|
wlr_scene_node_set_enabled(view_tree_on_top, false);
|
||||||
|
seat_focus_surface(&server->seat, NULL);
|
||||||
|
} else {
|
||||||
|
wlr_scene_node_set_enabled(view_tree, true);
|
||||||
|
wlr_scene_node_set_enabled(view_tree_on_top, true);
|
||||||
|
desktop_focus_topmost_mapped_view(server);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
desktop_toggle(struct server *server)
|
||||||
|
{
|
||||||
|
desktop_hide_windows(server, server->view_tree->node.enabled);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some xwayland apps produce unmapped surfaces on startup and also leave
|
* Some xwayland apps produce unmapped surfaces on startup and also leave
|
||||||
* some unmapped surfaces kicking around on 'close' (for example leafpad's
|
* some unmapped surfaces kicking around on 'close' (for example leafpad's
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue