Introduce stacking|tabbed_titlebar commands

Stacking and tabbed layouts effectively override the titlebar control of
the border command, always showing the titlebar to allow navigation.

Allow users to also hide the titlebar of stacking/tabbed layouts,
through new commands that specify whether titlebars for these layouts
should always be visible (the default) or if they should follow the
active container's border configuration.
This commit is contained in:
Kenny Levinsen 2024-07-13 12:32:08 +02:00
parent c30c451907
commit 5b855f7168
11 changed files with 178 additions and 1 deletions

View file

@ -124,6 +124,8 @@ sway_cmd cmd_commands;
sway_cmd cmd_create_output;
sway_cmd cmd_default_border;
sway_cmd cmd_default_floating_border;
sway_cmd cmd_default_stacking_titlebar;
sway_cmd cmd_default_tabbed_titlebar;
sway_cmd cmd_default_orientation;
sway_cmd cmd_exec;
sway_cmd cmd_exec_always;
@ -181,10 +183,12 @@ sway_cmd cmd_split;
sway_cmd cmd_splith;
sway_cmd cmd_splitt;
sway_cmd cmd_splitv;
sway_cmd cmd_stacking_titlebar;
sway_cmd cmd_sticky;
sway_cmd cmd_swaybg_command;
sway_cmd cmd_swaynag_command;
sway_cmd cmd_swap;
sway_cmd cmd_tabbed_titlebar;
sway_cmd cmd_tiling_drag;
sway_cmd cmd_tiling_drag_threshold;
sway_cmd cmd_title_align;

View file

@ -583,6 +583,9 @@ struct sway_config {
bool has_focused_tab_title;
bool stacking_titlebar_follows_border;
bool tabbed_titlebar_follows_border;
// floating view
int32_t floating_maximum_width;
int32_t floating_maximum_height;

View file

@ -60,6 +60,9 @@ struct sway_container_state {
bool border_left;
bool border_right;
bool stacking_titlebar_follows_border;
bool tabbed_titlebar_follows_border;
// These are in layout coordinates.
double content_x, content_y;
double content_width, content_height;
@ -217,6 +220,13 @@ void container_set_geometry_from_content(struct sway_container *con);
*/
bool container_is_floating(struct sway_container *container);
/**
* Determine if the given container should have a titlebar.
*
* Uses pending container state.
*/
bool container_has_titlebar(struct sway_container *container);
/**
* Get a container's box in layout coordinates.
*/