diff options
author | emersion <contact@emersion.fr> | 2018-11-28 21:00:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 21:00:34 +0100 |
commit | 659ab79b6612197caf6c0ec590fe772719c78da3 (patch) | |
tree | 6bb7b79bce9d132964e3faef36afddf7e319fb3f | |
parent | Merge pull request #3213 from RedSoxFan/fix-3203 (diff) | |
parent | Fix default_orientation auto (diff) | |
download | sway-659ab79b6612197caf6c0ec590fe772719c78da3.tar.gz sway-659ab79b6612197caf6c0ec590fe772719c78da3.tar.zst sway-659ab79b6612197caf6c0ec590fe772719c78da3.zip |
Merge pull request #3214 from RedSoxFan/fix-3156
Fix default_orientation auto
-rw-r--r-- | sway/tree/output.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c index 3c4614a8..6ff95579 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -88,11 +88,12 @@ void output_enable(struct sway_output *output, struct output_config *oc) { | |||
88 | 88 | ||
89 | restore_workspaces(output); | 89 | restore_workspaces(output); |
90 | 90 | ||
91 | struct sway_workspace *ws = NULL; | ||
91 | if (!output->workspaces->length) { | 92 | if (!output->workspaces->length) { |
92 | // Create workspace | 93 | // Create workspace |
93 | char *ws_name = workspace_next_name(wlr_output->name); | 94 | char *ws_name = workspace_next_name(wlr_output->name); |
94 | wlr_log(WLR_DEBUG, "Creating default workspace %s", ws_name); | 95 | wlr_log(WLR_DEBUG, "Creating default workspace %s", ws_name); |
95 | struct sway_workspace *ws = workspace_create(output, ws_name); | 96 | ws = workspace_create(output, ws_name); |
96 | // Set each seat's focus if not already set | 97 | // Set each seat's focus if not already set |
97 | struct sway_seat *seat = NULL; | 98 | struct sway_seat *seat = NULL; |
98 | wl_list_for_each(seat, &server.input->seats, link) { | 99 | wl_list_for_each(seat, &server.input->seats, link) { |
@@ -104,9 +105,15 @@ void output_enable(struct sway_output *output, struct output_config *oc) { | |||
104 | ipc_event_workspace(NULL, ws, "init"); | 105 | ipc_event_workspace(NULL, ws, "init"); |
105 | } | 106 | } |
106 | 107 | ||
107 | |||
108 | apply_output_config(oc, output); | 108 | apply_output_config(oc, output); |
109 | 109 | ||
110 | if (ws && config->default_orientation == L_NONE) { | ||
111 | // Since the output transformation and resolution could have changed | ||
112 | // due to applying the output config, the previously set layout for the | ||
113 | // created workspace may not be correct for `default_orientation auto` | ||
114 | ws->layout = output_get_default_layout(output); | ||
115 | } | ||
116 | |||
110 | input_manager_configure_xcursor(); | 117 | input_manager_configure_xcursor(); |
111 | 118 | ||
112 | wl_signal_add(&wlr_output->events.mode, &output->mode); | 119 | wl_signal_add(&wlr_output->events.mode, &output->mode); |