-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 a new command that specify whether grouped titlebar configurations should always be visible (the default) or if they should follow the active container's border configuration.
- Loading branch information
1 parent
8c5b23e
commit 6d746a3
Showing
11 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "log.h" | ||
#include "sway/commands.h" | ||
#include "sway/config.h" | ||
#include "sway/tree/container.h" | ||
|
||
struct cmd_results *cmd_default_grouped_titlebar(int argc, char **argv) { | ||
struct cmd_results *error = NULL; | ||
if ((error = checkarg(argc, "default_grouped_titlebar", EXPECTED_EQUAL_TO, 1))) { | ||
return error; | ||
} | ||
|
||
if (strcmp(argv[0], "always_visible") == 0) { | ||
config->grouped_titlebar_follows_border = false; | ||
} else if (strcmp(argv[0], "follows_border") == 0) { | ||
config->grouped_titlebar_follows_border = true; | ||
} else { | ||
return cmd_results_new(CMD_INVALID, | ||
"Expected 'default_grouped_titlebar <always_visible|follows_border>"); | ||
} | ||
|
||
return cmd_results_new(CMD_SUCCESS, NULL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "log.h" | ||
#include "sway/commands.h" | ||
#include "sway/config.h" | ||
#include "sway/tree/arrange.h" | ||
#include "sway/tree/container.h" | ||
#include "sway/tree/view.h" | ||
|
||
struct cmd_results *cmd_grouped_titlebar(int argc, char **argv) { | ||
struct cmd_results *error = NULL; | ||
if ((error = checkarg(argc, "border", EXPECTED_EQUAL_TO, 1))) { | ||
return error; | ||
} | ||
|
||
struct sway_container *container = config->handler_context.container; | ||
if (!container) { | ||
return cmd_results_new(CMD_INVALID, "No container to set"); | ||
} | ||
|
||
if (strcmp(argv[0], "always_visible") == 0) { | ||
container->pending.grouped_titlebar_follows_border = false; | ||
} else if (strcmp(argv[0], "follows_border") == 0) { | ||
container->pending.grouped_titlebar_follows_border = true; | ||
} else { | ||
return cmd_results_new(CMD_INVALID, | ||
"Expected 'grouped_titlebar <always_visible|follows_border>"); | ||
} | ||
|
||
if (container_is_floating(container)) { | ||
container_set_geometry_from_content(container); | ||
} | ||
|
||
arrange_container(container); | ||
|
||
return cmd_results_new(CMD_SUCCESS, NULL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters