1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 12:27:52 +00:00

wayland: clamp text width

This commit is contained in:
bi4k8 2022-12-12 20:46:15 +00:00 committed by Brenden Matthews
parent 06c33cc3b0
commit a6c52ee73f
No known key found for this signature in database
GPG Key ID: B49ABB7270D9D4FD

View File

@ -557,6 +557,13 @@ bool display_output_wayland::main_loop_wait(double t) {
if ((fixed_size == 0) && if ((fixed_size == 0) &&
(text_width + 2 * border_total != width || (text_width + 2 * border_total != width ||
text_height + 2 * border_total != height)) { 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; width = text_width + 2 * border_total;
height = text_height + 2 * border_total; height = text_height + 2 * border_total;
window_resize(global_window, width, height); /* resize window */ window_resize(global_window, width, height); /* resize window */