aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2018-11-28 13:52:54 -0500
committerBrian Ashworth <bosrsf04@gmail.com>2018-11-28 13:52:54 -0500
commit71ae08530a918f892f5b8cb45164340d5bb3c70f (patch)
tree6bb7b79bce9d132964e3faef36afddf7e319fb3f /sway
parent9924d72ab2c7a1202f8590f65377de23e8e39522 (diff)
Fix default_orientation auto
Since the output config is no longer applied before creating the default workspace, the layout for default workspaces on an output may not be correct. Due to the ordering of calls in output_enable being changed in several bug fix PRs, this just fixes the layout after the call to apply_output_config.
Diffstat (limited to 'sway')
-rw-r--r--sway/tree/output.c11
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) {
restore_workspaces(output);
+ struct sway_workspace *ws = NULL;
if (!output->workspaces->length) {
// Create workspace
char *ws_name = workspace_next_name(wlr_output->name);
wlr_log(WLR_DEBUG, "Creating default workspace %s", ws_name);
- struct sway_workspace *ws = workspace_create(output, ws_name);
+ ws = workspace_create(output, ws_name);
// Set each seat's focus if not already set
struct sway_seat *seat = NULL;
wl_list_for_each(seat, &server.input->seats, link) {
@@ -104,9 +105,15 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
ipc_event_workspace(NULL, ws, "init");
}
-
apply_output_config(oc, output);
+ if (ws && config->default_orientation == L_NONE) {
+ // Since the output transformation and resolution could have changed
+ // due to applying the output config, the previously set layout for the
+ // created workspace may not be correct for `default_orientation auto`
+ ws->layout = output_get_default_layout(output);
+ }
+
input_manager_configure_xcursor();
wl_signal_add(&wlr_output->events.mode, &output->mode);