diff options
-rw-r--r-- | include/sway/config.h | 1 | ||||
-rw-r--r-- | sway/commands/output.c | 3 | ||||
-rw-r--r-- | sway/config/output.c | 6 | ||||
-rw-r--r-- | sway/desktop/output.c | 23 |
4 files changed, 19 insertions, 14 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 4dd8e94c..139d7800 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <libinput.h> | 6 | #include <libinput.h> |
7 | #include <stdint.h> | 7 | #include <stdint.h> |
8 | #include <string.h> | 8 | #include <string.h> |
9 | #include <wayland-server.h> | ||
10 | #include <wlr/types/wlr_box.h> | 9 | #include <wlr/types/wlr_box.h> |
11 | #include <xkbcommon/xkbcommon.h> | 10 | #include <xkbcommon/xkbcommon.h> |
12 | #include <time.h> | 11 | #include <time.h> |
diff --git a/sway/commands/output.c b/sway/commands/output.c index be78358a..23792855 100644 --- a/sway/commands/output.c +++ b/sway/commands/output.c | |||
@@ -29,7 +29,8 @@ struct cmd_results *cmd_output(int argc, char **argv) { | |||
29 | 29 | ||
30 | struct output_config *output = new_output_config(); | 30 | struct output_config *output = new_output_config(); |
31 | if (!output) { | 31 | if (!output) { |
32 | return cmd_results_new(CMD_FAILURE, "output", "Unable to allocate output config"); | 32 | sway_log(L_ERROR, "Failed to allocate output config"); |
33 | return NULL; | ||
33 | } | 34 | } |
34 | output->name = strdup(name); | 35 | output->name = strdup(name); |
35 | 36 | ||
diff --git a/sway/config/output.c b/sway/config/output.c index ed47a617..6371763f 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -131,12 +131,6 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { | |||
131 | wlr_output_layout_add_auto(root_container.sway_root->output_layout, | 131 | wlr_output_layout_add_auto(root_container.sway_root->output_layout, |
132 | wlr_output); | 132 | wlr_output); |
133 | } | 133 | } |
134 | struct wlr_box *output_layout_box = wlr_output_layout_get_box( | ||
135 | root_container.sway_root->output_layout, wlr_output); | ||
136 | output->x = output_layout_box->x; | ||
137 | output->y = output_layout_box->y; | ||
138 | output->width = output_layout_box->width; | ||
139 | output->height = output_layout_box->height; | ||
140 | 134 | ||
141 | if (!oc || !oc->background) { | 135 | if (!oc || !oc->background) { |
142 | // Look for a * config for background | 136 | // Look for a * config for background |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index bcdaa7d2..3fd49846 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -91,19 +91,30 @@ static void output_frame_notify(struct wl_listener *listener, void *data) { | |||
91 | soutput->last_frame = now; | 91 | soutput->last_frame = now; |
92 | } | 92 | } |
93 | 93 | ||
94 | static void output_update_size(struct sway_output *output) { | ||
95 | struct wlr_box *output_layout_box = wlr_output_layout_get_box( | ||
96 | root_container.sway_root->output_layout, output->wlr_output); | ||
97 | output->swayc->x = output_layout_box->x; | ||
98 | output->swayc->y = output_layout_box->y; | ||
99 | output->swayc->width = output_layout_box->width; | ||
100 | output->swayc->height = output_layout_box->height; | ||
101 | |||
102 | arrange_windows(output->swayc, -1, -1); | ||
103 | } | ||
104 | |||
94 | static void output_resolution_notify(struct wl_listener *listener, void *data) { | 105 | static void output_resolution_notify(struct wl_listener *listener, void *data) { |
95 | struct sway_output *soutput = wl_container_of(listener, soutput, resolution); | 106 | struct sway_output *output = wl_container_of(listener, output, resolution); |
96 | arrange_windows(soutput->swayc, -1, -1); | 107 | output_update_size(output); |
97 | } | 108 | } |
98 | 109 | ||
99 | static void output_scale_notify(struct wl_listener *listener, void *data) { | 110 | static void output_scale_notify(struct wl_listener *listener, void *data) { |
100 | struct sway_output *soutput = wl_container_of(listener, soutput, scale); | 111 | struct sway_output *output = wl_container_of(listener, output, scale); |
101 | arrange_windows(soutput->swayc, -1, -1); | 112 | output_update_size(output); |
102 | } | 113 | } |
103 | 114 | ||
104 | static void output_transform_notify(struct wl_listener *listener, void *data) { | 115 | static void output_transform_notify(struct wl_listener *listener, void *data) { |
105 | struct sway_output *soutput = wl_container_of(listener, soutput, transform); | 116 | struct sway_output *output = wl_container_of(listener, output, transform); |
106 | arrange_windows(soutput->swayc, -1, -1); | 117 | output_update_size(output); |
107 | } | 118 | } |
108 | 119 | ||
109 | void output_add_notify(struct wl_listener *listener, void *data) { | 120 | void output_add_notify(struct wl_listener *listener, void *data) { |