*<action name="ToggleAlwaysOnTop">*
Toggle always-on-top of focused window.
+*<action name="ToggleAlwaysOnBottom">*
+ Toggle bewteen layers 'always-on-bottom' and 'normal'. When a window is
+ in the 'always-on-bottom' layer, it is rendered below all other
+ top-level windows. It is anticipated that this action will be useful
+ when defining window-rules for desktop-management tools that do not
+ support the wlr-layer-shell protocol.
+
*<action name="ToggleKeybinds">*
Stop handling keybinds other than ToggleKeybinds itself.
This can be used to allow A-Tab and similar keybinds to be delivered
/* Tree for all non-layer xdg/xwayland-shell surfaces with always-on-top/below */
struct wlr_scene_tree *view_tree_always_on_top;
+ struct wlr_scene_tree *view_tree_always_on_bottom;
#if HAVE_XWAYLAND
/* Tree for unmanaged xsurfaces without initialized view (usually popups) */
struct wlr_scene_tree *unmanaged_tree;
void view_set_fullscreen(struct view *view, bool fullscreen);
void view_toggle_maximize(struct view *view);
void view_toggle_decorations(struct view *view);
-void view_toggle_always_on_top(struct view *view);
+
bool view_is_always_on_top(struct view *view);
+void view_toggle_always_on_top(struct view *view);
+void view_toggle_always_on_bottom(struct view *view);
+
bool view_is_tiled(struct view *view);
bool view_is_floating(struct view *view);
void view_move_to_workspace(struct view *view, struct workspace *workspace);
ACTION_TYPE_TOGGLE_FULLSCREEN,
ACTION_TYPE_TOGGLE_DECORATIONS,
ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP,
+ ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM,
ACTION_TYPE_FOCUS,
ACTION_TYPE_ICONIFY,
ACTION_TYPE_MOVE,
"ToggleFullscreen",
"ToggleDecorations",
"ToggleAlwaysOnTop",
+ "ToggleAlwaysOnBottom",
"Focus",
"Iconify",
"Move",
view_toggle_always_on_top(view);
}
break;
+ case ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM:
+ if (view) {
+ view_toggle_always_on_bottom(view);
+ }
+ break;
case ACTION_TYPE_FOCUS:
if (view) {
desktop_focus_and_activate_view(&server->seat, view);
* | layer-shell | background-layer | Yes | swaybg
*/
+ server->view_tree_always_on_bottom = wlr_scene_tree_create(&server->scene->tree);
server->view_tree = wlr_scene_tree_create(&server->scene->tree);
server->view_tree_always_on_top = wlr_scene_tree_create(&server->scene->tree);
server->xdg_popup_tree = wlr_scene_tree_create(&server->scene->tree);
void
view_impl_map(struct view *view)
{
- if (!view->been_mapped) {
- window_rules_apply(view, LAB_WINDOW_RULE_EVENT_ON_FIRST_MAP);
- }
desktop_focus_and_activate_view(&view->server->seat, view);
view_move_to_front(view);
view_update_title(view);
view_update_app_id(view);
+ if (!view->been_mapped) {
+ window_rules_apply(view, LAB_WINDOW_RULE_EVENT_ON_FIRST_MAP);
+ }
}
static bool
}
}
+static bool
+view_is_always_on_bottom(struct view *view)
+{
+ assert(view);
+ return view->scene_tree->node.parent ==
+ view->server->view_tree_always_on_bottom;
+}
+
+void
+view_toggle_always_on_bottom(struct view *view)
+{
+ assert(view);
+ if (view_is_always_on_bottom(view)) {
+ view->workspace = view->server->workspace_current;
+ wlr_scene_node_reparent(&view->scene_tree->node,
+ view->workspace->tree);
+ } else {
+ wlr_scene_node_reparent(&view->scene_tree->node,
+ view->server->view_tree_always_on_bottom);
+ }
+}
+
void
view_move_to_workspace(struct view *view, struct workspace *workspace)
{