From cad6e632961c352f108233af039940387feffb9a Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 2 May 2023 11:35:28 +0200 Subject: libdecor: update with upstream source code as of 2023-may-2 This will allow to create narrow decorated windows without crash. --- libdecor/src/plugins/cairo/libdecor-cairo.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libdecor/src/plugins/cairo') diff --git a/libdecor/src/plugins/cairo/libdecor-cairo.c b/libdecor/src/plugins/cairo/libdecor-cairo.c index b105917d2..6113066a3 100644 --- a/libdecor/src/plugins/cairo/libdecor-cairo.c +++ b/libdecor/src/plugins/cairo/libdecor-cairo.c @@ -997,18 +997,25 @@ ensure_component(struct libdecor_frame_cairo *frame_cairo, static void ensure_border_surfaces(struct libdecor_frame_cairo *frame_cairo) { - int min_width, min_height; + int min_width, min_height, current_max_w, current_max_h; frame_cairo->shadow.opaque = false; ensure_component(frame_cairo, &frame_cairo->shadow); libdecor_frame_get_min_content_size(&frame_cairo->frame, &min_width, &min_height); - libdecor_frame_set_min_content_size(&frame_cairo->frame, - MAX(min_width, (int)MAX(56, 4 * BUTTON_WIDTH)), - MAX(min_height, (int)MAX(56, TITLE_HEIGHT + 1))); + min_width = MAX(min_width, (int)MAX(56, 4 * BUTTON_WIDTH)); + min_height = MAX(min_height, (int)MAX(56, TITLE_HEIGHT + 1)); + libdecor_frame_set_min_content_size(&frame_cairo->frame, min_width, min_height); + libdecor_frame_get_max_content_size(&frame_cairo->frame, ¤t_max_w, + ¤t_max_h); + if (current_max_w && current_max_w < min_width) current_max_w = min_width; + if (current_max_h && current_max_h < min_height) current_max_h = min_height; + libdecor_frame_set_max_content_size(&frame_cairo->frame, current_max_w, + current_max_h); } + static void ensure_title_bar_surfaces(struct libdecor_frame_cairo *frame_cairo) { -- cgit v1.2.3