aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-08-12 19:49:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-08-12 19:49:17 +0000
commitc2451e2a80cd72c17b8c29b51130adaad8dfe31f (patch)
treea5dcf6a1712dc6b2aa9e066ef86ff35e90c31d91 /render.c
parentinput: free previous XKB state when we get a new one (diff)
output: track output we're mapped on, and use maximum scale
Our surface may be on multiple outputs at the same time. In this case, we use the largest scale factor, and let the compositor down scale on the "other" output(s).
Diffstat (limited to 'render.c')
-rw-r--r--render.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/render.c b/render.c
index d6f4a5de..b2fa4117 100644
--- a/render.c
+++ b/render.c
@@ -675,8 +675,19 @@ reflow(struct row **new_grid, int new_cols, int new_rows,
/* Move to terminal.c? */
void
-render_resize(struct terminal *term, int width, int height, int scale)
+render_resize(struct terminal *term, int width, int height)
{
+ int scale = -1;
+ tll_foreach(term->wl.on_outputs, it) {
+ if (it->item->scale > scale)
+ scale = it->item->scale;
+ }
+
+ if (scale == -1) {
+ /* Haven't 'entered' an output yet? */
+ scale = 1;
+ }
+
width *= term->scale;
height *= term->scale;