From a6c52ee73f96ee733eae74ed3a260046b18496e4 Mon Sep 17 00:00:00 2001 From: bi4k8 Date: Mon, 12 Dec 2022 20:46:15 +0000 Subject: [PATCH] wayland: clamp text width --- src/display-wayland.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/display-wayland.cc b/src/display-wayland.cc index 236f0e2c..3dbcea61 100644 --- a/src/display-wayland.cc +++ b/src/display-wayland.cc @@ -557,6 +557,13 @@ bool display_output_wayland::main_loop_wait(double t) { if ((fixed_size == 0) && (text_width + 2 * border_total != width || text_height + 2 * border_total != height)) { + + /* clamp text_width to configured maximum */ + if (maximum_width.get(*state)) { + int mw = global_window->scale * maximum_width.get(*state); + if (text_width > mw && mw > 0) { text_width = mw; } + } + width = text_width + 2 * border_total; height = text_height + 2 * border_total; window_resize(global_window, width, height); /* resize window */