mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
cmd_fullscreen: ignore fullscreen request on workspaces
This commit is contained in:
parent
d45623c2db
commit
137dbf3e6d
|
@ -18,16 +18,13 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) {
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Can't run this command while there's no outputs connected.");
|
"Can't run this command while there's no outputs connected.");
|
||||||
}
|
}
|
||||||
struct sway_node *node = config->handler_context.node;
|
|
||||||
struct sway_container *container = config->handler_context.container;
|
struct sway_container *container = config->handler_context.container;
|
||||||
struct sway_workspace *workspace = config->handler_context.workspace;
|
|
||||||
if (node->type == N_WORKSPACE && workspace->tiling->length == 0) {
|
|
||||||
return cmd_results_new(CMD_FAILURE,
|
|
||||||
"Can't fullscreen an empty workspace");
|
|
||||||
}
|
|
||||||
|
|
||||||
// If in the scratchpad, operate on the highest container
|
if (!container) {
|
||||||
if (container && !container->pending.workspace) {
|
// If the focus is not a container, do nothing successfully
|
||||||
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
} else if (!container->pending.workspace) {
|
||||||
|
// If in the scratchpad, operate on the highest container
|
||||||
while (container->pending.parent) {
|
while (container->pending.parent) {
|
||||||
container = container->pending.parent;
|
container = container->pending.parent;
|
||||||
}
|
}
|
||||||
|
@ -49,13 +46,6 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) {
|
||||||
global = strcasecmp(argv[1], "global") == 0;
|
global = strcasecmp(argv[1], "global") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable && node->type == N_WORKSPACE) {
|
|
||||||
// Wrap the workspace's children in a container so we can fullscreen it
|
|
||||||
container = workspace_wrap_children(workspace);
|
|
||||||
workspace->layout = L_HORIZ;
|
|
||||||
seat_set_focus_container(config->handler_context.seat, container);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum sway_fullscreen_mode mode = FULLSCREEN_NONE;
|
enum sway_fullscreen_mode mode = FULLSCREEN_NONE;
|
||||||
if (enable) {
|
if (enable) {
|
||||||
mode = global ? FULLSCREEN_GLOBAL : FULLSCREEN_WORKSPACE;
|
mode = global ? FULLSCREEN_GLOBAL : FULLSCREEN_WORKSPACE;
|
||||||
|
|
Loading…
Reference in a new issue