mirror of
https://github.com/labwc/labwc.git
synced 2026-02-08 10:06:59 -05:00
parent
98bf316ee6
commit
13d0b14244
5 changed files with 48 additions and 11 deletions
|
|
@ -393,6 +393,12 @@ void desktop_arrange_all_views(struct server *server);
|
||||||
void desktop_focus_output(struct output *output);
|
void desktop_focus_output(struct output *output);
|
||||||
struct view *desktop_topmost_focusable_view(struct server *server);
|
struct view *desktop_topmost_focusable_view(struct server *server);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggles the (output local) visibility of the layershell top layer
|
||||||
|
* based on the existence of a fullscreen window on the current workspace.
|
||||||
|
*/
|
||||||
|
void desktop_update_top_layer_visiblity(struct server *server);
|
||||||
|
|
||||||
enum lab_cycle_dir {
|
enum lab_cycle_dir {
|
||||||
LAB_CYCLE_DIR_NONE,
|
LAB_CYCLE_DIR_NONE,
|
||||||
LAB_CYCLE_DIR_FORWARD,
|
LAB_CYCLE_DIR_FORWARD,
|
||||||
|
|
|
||||||
|
|
@ -225,8 +225,9 @@ struct xdg_toplevel_view {
|
||||||
enum lab_view_criteria {
|
enum lab_view_criteria {
|
||||||
LAB_VIEW_CRITERIA_NONE = 0,
|
LAB_VIEW_CRITERIA_NONE = 0,
|
||||||
LAB_VIEW_CRITERIA_CURRENT_WORKSPACE = 1 << 0,
|
LAB_VIEW_CRITERIA_CURRENT_WORKSPACE = 1 << 0,
|
||||||
LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP = 1 << 1,
|
LAB_VIEW_CRITERIA_FULLSCREEN = 1 << 1,
|
||||||
LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER = 1 << 2,
|
LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP = 1 << 2,
|
||||||
|
LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER = 1 << 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,32 @@ desktop_focus_output(struct output *output)
|
||||||
cursor_update_focus(output->server);
|
cursor_update_focus(output->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
desktop_update_top_layer_visiblity(struct server *server)
|
||||||
|
{
|
||||||
|
struct view *view;
|
||||||
|
struct output *output;
|
||||||
|
uint32_t top = ZWLR_LAYER_SHELL_V1_LAYER_TOP;
|
||||||
|
|
||||||
|
/* Enable all top layers */
|
||||||
|
wl_list_for_each(output, &server->outputs, link) {
|
||||||
|
if (!output_is_usable(output)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
wlr_scene_node_set_enabled(&output->layer_tree[top]->node, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* And disable them again when there is a view in fullscreen */
|
||||||
|
enum lab_view_criteria criteria =
|
||||||
|
LAB_VIEW_CRITERIA_CURRENT_WORKSPACE | LAB_VIEW_CRITERIA_FULLSCREEN;
|
||||||
|
for_each_view(view, &server->views, criteria) {
|
||||||
|
if (!output_is_usable(view->output)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
wlr_scene_node_set_enabled(&view->output->layer_tree[top]->node, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static struct wlr_surface *
|
static struct wlr_surface *
|
||||||
get_surface_from_layer_node(struct wlr_scene_node *node)
|
get_surface_from_layer_node(struct wlr_scene_node *node)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
19
src/view.c
19
src/view.c
|
|
@ -100,6 +100,11 @@ matches_criteria(struct view *view, enum lab_view_criteria criteria)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (criteria & LAB_VIEW_CRITERIA_FULLSCREEN) {
|
||||||
|
if (!view->fullscreen) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (criteria & LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP) {
|
if (criteria & LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP) {
|
||||||
if (view_is_always_on_top(view)) {
|
if (view_is_always_on_top(view)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1122,9 +1127,7 @@ set_fullscreen(struct view *view, bool fullscreen)
|
||||||
|
|
||||||
/* Show fullscreen views above top-layer */
|
/* Show fullscreen views above top-layer */
|
||||||
if (view->output) {
|
if (view->output) {
|
||||||
uint32_t top = ZWLR_LAYER_SHELL_V1_LAYER_TOP;
|
desktop_update_top_layer_visiblity(view->server);
|
||||||
wlr_scene_node_set_enabled(&view->output->layer_tree[top]->node,
|
|
||||||
!fullscreen);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1662,13 +1665,12 @@ view_destroy(struct view *view)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The layer-shell top-layer is disabled when an application is running
|
* The layer-shell top-layer is disabled when an application is running
|
||||||
* in fullscreen mode, so if that's the case, we have to re-enable it
|
* in fullscreen mode, so if that's the case, we may have to re-enable
|
||||||
* here.
|
* it here.
|
||||||
*/
|
*/
|
||||||
if (view->fullscreen && view->output) {
|
if (view->fullscreen && view->output) {
|
||||||
uint32_t top = ZWLR_LAYER_SHELL_V1_LAYER_TOP;
|
view->fullscreen = false;
|
||||||
wlr_scene_node_set_enabled(&view->output->layer_tree[top]->node,
|
desktop_update_top_layer_visiblity(server);
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we spawned a window menu, close it */
|
/* If we spawned a window menu, close it */
|
||||||
|
|
@ -1685,4 +1687,3 @@ view_destroy(struct view *view)
|
||||||
cursor_update_focus(server);
|
cursor_update_focus(server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,9 @@ workspaces_switch_to(struct workspace *target, bool update_focus)
|
||||||
* cursor image from the previous desktop
|
* cursor image from the previous desktop
|
||||||
*/
|
*/
|
||||||
cursor_update_focus(server);
|
cursor_update_focus(server);
|
||||||
|
|
||||||
|
/* Ensure that only currently visible fullscreen windows hide the top layer */
|
||||||
|
desktop_update_top_layer_visiblity(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue