diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-05-02 11:35:28 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-05-02 11:35:28 +0200 |
| commit | cad6e632961c352f108233af039940387feffb9a (patch) | |
| tree | 33d0fef574362efdd653155a4c8defdac1b7734a /libdecor/src | |
| parent | 0394a27074b8067bf22b586ab52f22d79f088f10 (diff) | |
libdecor: update with upstream source code as of 2023-may-2
This will allow to create narrow decorated windows without crash.
Diffstat (limited to 'libdecor/src')
| -rw-r--r-- | libdecor/src/libdecor-fallback.c | 9 | ||||
| -rw-r--r-- | libdecor/src/plugins/cairo/libdecor-cairo.c | 15 | ||||
| -rw-r--r-- | libdecor/src/plugins/gtk/libdecor-gtk.c | 10 |
3 files changed, 24 insertions, 10 deletions
diff --git a/libdecor/src/libdecor-fallback.c b/libdecor/src/libdecor-fallback.c index 7f5f2fddc..ea0d35b03 100644 --- a/libdecor/src/libdecor-fallback.c +++ b/libdecor/src/libdecor-fallback.c @@ -150,7 +150,14 @@ libdecor_plugin_fallback_frame_get_border_size(struct libdecor_plugin *plugin, int *top, int *bottom) { - *left = *right = *top = *bottom = 0; + if (left) + *left = 0; + if (right) + *right = 0; + if (top) + *top = 0; + if (bottom) + *bottom = 0; return true; } 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) { diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c index 228161e43..b0b1b2f36 100644 --- a/libdecor/src/plugins/gtk/libdecor-gtk.c +++ b/libdecor/src/plugins/gtk/libdecor-gtk.c @@ -1350,7 +1350,7 @@ draw_title_bar(struct libdecor_frame_gtk *frame_gtk) enum libdecor_window_state state; GtkStyleContext *style; int pref_width; - int current_min_w, current_min_h, W, H; + int current_min_w, current_min_h, current_max_w, current_max_h, W, H; state = libdecor_frame_get_window_state((struct libdecor_frame*)frame_gtk); style = gtk_widget_get_style_context(frame_gtk->window); @@ -1378,10 +1378,10 @@ draw_title_bar(struct libdecor_frame_gtk *frame_gtk) if (current_min_w < pref_width) { current_min_w = pref_width; libdecor_frame_set_min_content_size(&frame_gtk->frame, current_min_w, current_min_h); - if (!resizable(frame_gtk)) { - libdecor_frame_set_max_content_size(&frame_gtk->frame, - current_min_w, current_min_h); - } + } + libdecor_frame_get_max_content_size(&frame_gtk->frame, ¤t_max_w, ¤t_max_h); + if (current_max_w && current_max_w < current_min_w) { + libdecor_frame_set_max_content_size(&frame_gtk->frame, current_min_w, current_max_h); } W = libdecor_frame_get_content_width(&frame_gtk->frame); H = libdecor_frame_get_content_height(&frame_gtk->frame); |
