From 8ddafeeaae44db77bfdb55d1776513d88a58f68e Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Fri, 4 Mar 2016 16:44:49 +0100 Subject: Fix assigning workspaces to outputs It's possible to assign workspaces to certain outputs using the command: workspace output However, this did not work in some cases where the workspace was assigned before the given output was made available to sway. This patch fixes those cases. --- include/workspace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/workspace.h b/include/workspace.h index c69ccdbb..6911e3d4 100644 --- a/include/workspace.h +++ b/include/workspace.h @@ -7,7 +7,7 @@ extern char *prev_workspace_name; -char *workspace_next_name(void); +char *workspace_next_name(const char *output_name); swayc_t *workspace_create(const char*); swayc_t *workspace_by_name(const char*); swayc_t *workspace_by_number(const char*); -- cgit v1.2.3 From f63512480c058b9ebe80c2dd5f43fd6597811ef4 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Thu, 17 Mar 2016 23:31:14 +0100 Subject: Remove unused panel_size (and fix rearrange) desktop_shell.panel_size was only used to determine if sway should rearrange the output when rendering the panel in the output_pre_render hook. This is not needed since the output will have been arranged at that point. It also caused sway to rearrange all the time when running with two or more different monitors/resolutions because panel_size kept changing with every output_pre_render callback. Should fix #514 --- include/extensions.h | 1 - sway/extensions.c | 1 - sway/handlers.c | 4 ---- 3 files changed, 6 deletions(-) (limited to 'include') diff --git a/include/extensions.h b/include/extensions.h index 164688ee..158a40a2 100644 --- a/include/extensions.h +++ b/include/extensions.h @@ -28,7 +28,6 @@ struct desktop_shell_state { list_t *panels; list_t *lock_surfaces; bool is_locked; - struct wlc_size panel_size; }; struct swaylock_state { diff --git a/sway/extensions.c b/sway/extensions.c index 9283b656..c646ac91 100644 --- a/sway/extensions.c +++ b/sway/extensions.c @@ -93,7 +93,6 @@ static void set_panel(struct wl_client *client, struct wl_resource *resource, config->surface = wlc_resource_from_wl_surface_resource(surface); config->wl_surface_res = surface; wl_resource_set_destructor(surface, panel_surface_destructor); - desktop_shell.panel_size = *wlc_surface_get_size(config->surface); arrange_windows(&root_container, -1, -1); wlc_output_schedule_render(config->output); } diff --git a/sway/handlers.c b/sway/handlers.c index 69f325eb..d992a7b6 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -141,10 +141,6 @@ static void handle_output_pre_render(wlc_handle output) { break; } wlc_surface_render(config->surface, &geo); - if (size.w != desktop_shell.panel_size.w || size.h != desktop_shell.panel_size.h) { - desktop_shell.panel_size = size; - arrange_windows(&root_container, -1, -1); - } break; } } -- cgit v1.2.3