mirror of
https://github.com/swaywm/sway.git
synced 2026-04-17 06:46:32 -04:00
Merge ffe1948d52 into 909a2ddb5f
This commit is contained in:
commit
739a219a80
7 changed files with 36 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ sway_cmd cmd_client_focused;
|
||||||
sway_cmd cmd_client_focused_inactive;
|
sway_cmd cmd_client_focused_inactive;
|
||||||
sway_cmd cmd_client_focused_tab_title;
|
sway_cmd cmd_client_focused_tab_title;
|
||||||
sway_cmd cmd_client_unfocused;
|
sway_cmd cmd_client_unfocused;
|
||||||
|
sway_cmd cmd_client_unfocused_tab_title;
|
||||||
sway_cmd cmd_client_urgent;
|
sway_cmd cmd_client_urgent;
|
||||||
sway_cmd cmd_client_placeholder;
|
sway_cmd cmd_client_placeholder;
|
||||||
sway_cmd cmd_client_background;
|
sway_cmd cmd_client_background;
|
||||||
|
|
|
||||||
|
|
@ -576,12 +576,14 @@ struct sway_config {
|
||||||
struct border_colors focused_inactive;
|
struct border_colors focused_inactive;
|
||||||
struct border_colors focused_tab_title;
|
struct border_colors focused_tab_title;
|
||||||
struct border_colors unfocused;
|
struct border_colors unfocused;
|
||||||
|
struct border_colors unfocused_tab_title;
|
||||||
struct border_colors urgent;
|
struct border_colors urgent;
|
||||||
struct border_colors placeholder;
|
struct border_colors placeholder;
|
||||||
float background[4];
|
float background[4];
|
||||||
} border_colors;
|
} border_colors;
|
||||||
|
|
||||||
bool has_focused_tab_title;
|
bool has_focused_tab_title;
|
||||||
|
bool has_unfocused_tab_title;
|
||||||
|
|
||||||
// floating view
|
// floating view
|
||||||
int32_t floating_maximum_width;
|
int32_t floating_maximum_width;
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ static const struct cmd_handler handlers[] = {
|
||||||
{ "client.focused_tab_title", cmd_client_focused_tab_title },
|
{ "client.focused_tab_title", cmd_client_focused_tab_title },
|
||||||
{ "client.placeholder", cmd_client_noop },
|
{ "client.placeholder", cmd_client_noop },
|
||||||
{ "client.unfocused", cmd_client_unfocused },
|
{ "client.unfocused", cmd_client_unfocused },
|
||||||
|
{ "client.unfocused_tab_title", cmd_client_unfocused_tab_title },
|
||||||
{ "client.urgent", cmd_client_urgent },
|
{ "client.urgent", cmd_client_urgent },
|
||||||
{ "default_border", cmd_default_border },
|
{ "default_border", cmd_default_border },
|
||||||
{ "default_floating_border", cmd_default_floating_border },
|
{ "default_floating_border", cmd_default_floating_border },
|
||||||
|
|
|
||||||
|
|
@ -90,3 +90,13 @@ struct cmd_results *cmd_client_focused_tab_title(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct cmd_results *cmd_client_unfocused_tab_title(int argc, char **argv) {
|
||||||
|
struct cmd_results *result = handle_command(argc, argv,
|
||||||
|
"client.unfocused_tab_title",
|
||||||
|
&config->border_colors.unfocused_tab_title, "#2e9ef4ff");
|
||||||
|
if (result && result->status == CMD_SUCCESS) {
|
||||||
|
config->has_unfocused_tab_title = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -309,6 +309,7 @@ static void config_defaults(struct sway_config *config) {
|
||||||
config->hide_lone_tab = false;
|
config->hide_lone_tab = false;
|
||||||
|
|
||||||
config->has_focused_tab_title = false;
|
config->has_focused_tab_title = false;
|
||||||
|
config->has_unfocused_tab_title = false;
|
||||||
|
|
||||||
// border colors
|
// border colors
|
||||||
color_to_rgba(config->border_colors.focused.border, 0x4C7899FF);
|
color_to_rgba(config->border_colors.focused.border, 0x4C7899FF);
|
||||||
|
|
|
||||||
|
|
@ -620,6 +620,11 @@ runtime.
|
||||||
*client.unfocused*
|
*client.unfocused*
|
||||||
A window that does not have focus.
|
A window that does not have focus.
|
||||||
|
|
||||||
|
*client.unfocused_tab_title*
|
||||||
|
Title of a tab or stack container that does not have focus. Defaults to
|
||||||
|
unfocused if not specified and does not use the indicator and child_border
|
||||||
|
colors.
|
||||||
|
|
||||||
*client.urgent*
|
*client.urgent*
|
||||||
A window with an urgency hint. *Note*: Native Wayland windows do not
|
A window with an urgency hint. *Note*: Native Wayland windows do not
|
||||||
support urgency. Urgency only works for Xwayland windows.
|
support urgency. Urgency only works for Xwayland windows.
|
||||||
|
|
@ -681,6 +686,12 @@ The default colors are:
|
||||||
: #888888
|
: #888888
|
||||||
: #292d2e
|
: #292d2e
|
||||||
: #222222
|
: #222222
|
||||||
|
| *unfocused_tab_title*
|
||||||
|
: #333333
|
||||||
|
: #222222
|
||||||
|
: #888888
|
||||||
|
: n/a
|
||||||
|
: n/a
|
||||||
| *urgent*
|
| *urgent*
|
||||||
: #2f343a
|
: #2f343a
|
||||||
: #900000
|
: #900000
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,14 @@ static bool container_has_focused_child(struct sway_container *con) {
|
||||||
return container_find_child(con, container_is_focused, NULL);
|
return container_find_child(con, container_is_focused, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool container_is_container(struct sway_container *con, void *data) {
|
||||||
|
return true; // intentional tautology
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool container_has_child(struct sway_container *con) {
|
||||||
|
return container_find_child(con, container_is_container, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static bool container_is_current_parent_focused(struct sway_container *con) {
|
static bool container_is_current_parent_focused(struct sway_container *con) {
|
||||||
if (con->current.parent) {
|
if (con->current.parent) {
|
||||||
struct sway_container *parent = con->current.parent;
|
struct sway_container *parent = con->current.parent;
|
||||||
|
|
@ -226,6 +234,8 @@ static struct border_colors *container_get_current_colors(
|
||||||
colors = &config->border_colors.focused_tab_title;
|
colors = &config->border_colors.focused_tab_title;
|
||||||
} else if (con == active_child) {
|
} else if (con == active_child) {
|
||||||
colors = &config->border_colors.focused_inactive;
|
colors = &config->border_colors.focused_inactive;
|
||||||
|
} else if (config->has_unfocused_tab_title && container_has_child(con)) {
|
||||||
|
colors = &config->border_colors.unfocused_tab_title;
|
||||||
} else {
|
} else {
|
||||||
colors = &config->border_colors.unfocused;
|
colors = &config->border_colors.unfocused;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue