From 16ef702645adef3a55d0641d092b6d26b81bb3c6 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 22 Oct 2018 21:51:10 +1000 Subject: [PATCH 1/4] Fix xwayland wants_floating logic --- sway/desktop/xwayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index b8ac8434b..5305ce129 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -239,7 +239,7 @@ static bool wants_floating(struct sway_view *view) { struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; if (size_hints != NULL && - size_hints->min_width != 0 && size_hints->min_height != 0 && + size_hints->min_width > 0 && size_hints->min_height > 0 && (size_hints->max_width == size_hints->min_width || size_hints->max_height == size_hints->min_height)) { return true; From 662466e8db773926bf61b21280194a3540ae26ec Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 23 Oct 2018 00:02:08 +1000 Subject: [PATCH 2/4] Fix crash when resizing container hidden in the scratchpad Firstly, the container was wrongly identifying as a tiling container because it had no workspace. Secondly, when calculating the maximum possible size we can't use the workspace if it's not there, so we'll allow unlimited size in this case. --- sway/commands/resize.c | 4 ++-- sway/tree/container.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sway/commands/resize.c b/sway/commands/resize.c index 6de14ca3f..8666f40be 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c @@ -94,7 +94,7 @@ static void calculate_constraints(int *min_width, int *max_width, *min_height = config->floating_minimum_height; } - if (config->floating_maximum_width == -1) { // no maximum + if (config->floating_maximum_width == -1 || !con->workspace) { // no max *max_width = INT_MAX; } else if (config->floating_maximum_width == 0) { // automatic *max_width = con->workspace->width; @@ -102,7 +102,7 @@ static void calculate_constraints(int *min_width, int *max_width, *max_width = config->floating_maximum_width; } - if (config->floating_maximum_height == -1) { // no maximum + if (config->floating_maximum_height == -1 || !con->workspace) { // no max *max_height = INT_MAX; } else if (config->floating_maximum_height == 0) { // automatic *max_height = con->workspace->height; diff --git a/sway/tree/container.c b/sway/tree/container.c index b41e8dd4c..58d3df344 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -727,8 +727,14 @@ void container_set_geometry_from_floating_view(struct sway_container *con) { } bool container_is_floating(struct sway_container *container) { - return !container->parent && container->workspace && - list_find(container->workspace->floating, container) != -1; + if (!container->parent && container->workspace && + list_find(container->workspace->floating, container) != -1) { + return true; + } + if (container->scratchpad) { + return true; + } + return false; } void container_get_box(struct sway_container *container, struct wlr_box *box) { From 31f82830b22cd8cafd61a498b03f2bb137e37f89 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 22 Oct 2018 17:52:41 -0400 Subject: [PATCH 3/4] config: remove peeked + expanded line log entries The peeked and expanded line log entries were useful during the switch to generic code blocks and subcommands. However, it has been a while since those were introduced and the log entries are no longer helpful for any remaining issues with config parsing. Instead of keeping them as clutter in the log, they can just be removed. --- sway/config.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sway/config.c b/sway/config.c index b9cb0a1c1..9ec403679 100644 --- a/sway/config.c +++ b/sway/config.c @@ -584,13 +584,11 @@ static int detect_brace_on_following_line(FILE *file, char *line, char *peeked = NULL; long position = 0; do { - wlr_log(WLR_DEBUG, "Peeking line %d", line_number + lines + 1); free(peeked); peeked = peek_line(file, lines, &position); if (peeked) { peeked = strip_whitespace(peeked); } - wlr_log(WLR_DEBUG, "Peeked line: `%s`", peeked); lines++; } while (peeked && strlen(peeked) == 0); @@ -695,7 +693,6 @@ bool read_config(FILE *file, struct sway_config *config, free(line); return false; } - wlr_log(WLR_DEBUG, "Expanded line: %s", expanded); struct cmd_results *res; if (block && strcmp(block, "") == 0) { // Special case From f530ac64598bdb73346a18e9754d9781fddf9446 Mon Sep 17 00:00:00 2001 From: mteyssier Date: Mon, 22 Oct 2018 22:47:26 +0200 Subject: [PATCH 4/4] Add references to sway-output(5) in sway(5) - update ref in the swaybg_command description - add ref to sway-output(5) in See Also - add an `output` command description --- sway/sway.5.scd | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sway/sway.5.scd b/sway/sway.5.scd index 51fd260b4..1999a6c82 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd @@ -69,7 +69,7 @@ The following commands may only be used in the configuration file. *swaybg\_command* Executes custom background _command_. Default is _swaybg_. Refer to - *output* below for more information. + *sway-output*(5) for more information. It can be disabled by setting the command to a single dash: _swaybg\_command -_ @@ -495,6 +495,12 @@ The default colors are: Prevents windows matching from being focused automatically when they're created. This has no effect on the first window in a workspace. +*output* + For details on output subcommands, see *sway-output*(5). + + \* may be used in lieu of a specific output name to configure all outputs. + A list of output names may be obtained via *swaymsg -t get\_outputs*. + *popup\_during\_fullscreen* smart|ignore|leave\_fullscreen Determines what to do when a fullscreen view opens a dialog. If _smart_ (the default), the dialog will be displayed. If _ignore_, the @@ -669,4 +675,4 @@ The following attributes may be matched with: # SEE ALSO -*sway*(1) *sway-input*(5) *sway-bar*(5) +*sway*(1) *sway-input*(5) *sway-output*(5) *sway-bar*(5)