aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 9e0c18e4..033a4c44 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -8,6 +8,7 @@
8#include <wlr/render/matrix.h> 8#include <wlr/render/matrix.h>
9#include "log.h" 9#include "log.h"
10#include "sway/container.h" 10#include "sway/container.h"
11#include "sway/layout.h"
11#include "sway/output.h" 12#include "sway/output.h"
12#include "sway/server.h" 13#include "sway/server.h"
13#include "sway/view.h" 14#include "sway/view.h"
@@ -25,10 +26,9 @@ static void output_frame_view(swayc_t *view, void *data) {
25 return; 26 return;
26 } 27 }
27 // TODO 28 // TODO
28 // - Force sway's resolution
29 // - Deal with wlr_output_layout 29 // - Deal with wlr_output_layout
30 int width = surface->current->width; 30 int width = sway_view->swayc->width;
31 int height = surface->current->height; 31 int height = sway_view->swayc->height;
32 int render_width = width * wlr_output->scale; 32 int render_width = width * wlr_output->scale;
33 int render_height = height * wlr_output->scale; 33 int render_height = height * wlr_output->scale;
34 double ox = view->x, oy = view->y; 34 double ox = view->x, oy = view->y;
@@ -101,6 +101,12 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
101 soutput->last_frame = now; 101 soutput->last_frame = now;
102} 102}
103 103
104static void output_resolution_notify(struct wl_listener *listener, void *data) {
105 struct sway_output *soutput = wl_container_of(
106 listener, soutput, resolution);
107 arrange_windows(soutput->swayc, -1, -1);
108}
109
104void output_add_notify(struct wl_listener *listener, void *data) { 110void output_add_notify(struct wl_listener *listener, void *data) {
105 struct sway_server *server = wl_container_of(listener, server, output_add); 111 struct sway_server *server = wl_container_of(listener, server, output_add);
106 struct wlr_output *wlr_output = data; 112 struct wlr_output *wlr_output = data;
@@ -113,6 +119,9 @@ void output_add_notify(struct wl_listener *listener, void *data) {
113 119
114 output->frame.notify = output_frame_notify; 120 output->frame.notify = output_frame_notify;
115 wl_signal_add(&wlr_output->events.frame, &output->frame); 121 wl_signal_add(&wlr_output->events.frame, &output->frame);
122
123 output->resolution.notify = output_resolution_notify;
124 wl_signal_add(&wlr_output->events.resolution, &output->resolution);
116} 125}
117 126
118void output_remove_notify(struct wl_listener *listener, void *data) { 127void output_remove_notify(struct wl_listener *listener, void *data) {