libdecor: update with upstream source code as of 2023-may-2

This will allow to create narrow decorated windows without crash.
This commit is contained in:
ManoloFLTK 2023-05-02 11:35:28 +02:00
parent 0394a27074
commit cad6e63296
4 changed files with 26 additions and 12 deletions

View File

@ -23,14 +23,14 @@ The nanosvg library is not affected.
\section bundled-status Current status \section bundled-status Current status
\code \code
Current versions of bundled libraries (as of Jan 16, 2023): Current versions of bundled libraries (as of May 2, 2023):
Library Version/git commit Release date FLTK Version Library Version/git commit Release date FLTK Version
-------------------------------------------------------------------------- --------------------------------------------------------------------------
jpeg jpeg-9e 2022-01-16 1.4.0 jpeg jpeg-9e 2022-01-16 1.4.0
nanosvg abcd277ea4 [1] 2022-12-22 1.4.0 nanosvg abcd277ea4 [1] 2022-12-22 1.4.0
png libpng-1.6.39 2022-11-20 1.4.0 png libpng-1.6.39 2022-11-20 1.4.0
zlib zlib-1.2.13 2022-10-13 1.4.0 zlib zlib-1.2.13 2022-10-13 1.4.0
libdecor 3f3e5e1d [2] 2022-12-29 1.4.0 libdecor db4e5084 [2] 2023-05-01 1.4.0
-------------------------------------------------------------------------- --------------------------------------------------------------------------
Previous versions of bundled libraries (FLTK 1.3.x): Previous versions of bundled libraries (FLTK 1.3.x):

View File

@ -150,7 +150,14 @@ libdecor_plugin_fallback_frame_get_border_size(struct libdecor_plugin *plugin,
int *top, int *top,
int *bottom) 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; return true;
} }

View File

@ -997,18 +997,25 @@ ensure_component(struct libdecor_frame_cairo *frame_cairo,
static void static void
ensure_border_surfaces(struct libdecor_frame_cairo *frame_cairo) 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; frame_cairo->shadow.opaque = false;
ensure_component(frame_cairo, &frame_cairo->shadow); ensure_component(frame_cairo, &frame_cairo->shadow);
libdecor_frame_get_min_content_size(&frame_cairo->frame, libdecor_frame_get_min_content_size(&frame_cairo->frame,
&min_width, &min_height); &min_width, &min_height);
libdecor_frame_set_min_content_size(&frame_cairo->frame, min_width = MAX(min_width, (int)MAX(56, 4 * BUTTON_WIDTH));
MAX(min_width, (int)MAX(56, 4 * BUTTON_WIDTH)), min_height = MAX(min_height, (int)MAX(56, TITLE_HEIGHT + 1));
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, &current_max_w,
&current_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 static void
ensure_title_bar_surfaces(struct libdecor_frame_cairo *frame_cairo) ensure_title_bar_surfaces(struct libdecor_frame_cairo *frame_cairo)
{ {

View File

@ -1350,7 +1350,7 @@ draw_title_bar(struct libdecor_frame_gtk *frame_gtk)
enum libdecor_window_state state; enum libdecor_window_state state;
GtkStyleContext *style; GtkStyleContext *style;
int pref_width; 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); state = libdecor_frame_get_window_state((struct libdecor_frame*)frame_gtk);
style = gtk_widget_get_style_context(frame_gtk->window); 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) { if (current_min_w < pref_width) {
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); 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, &current_max_w, &current_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); W = libdecor_frame_get_content_width(&frame_gtk->frame);
H = libdecor_frame_get_content_height(&frame_gtk->frame); H = libdecor_frame_get_content_height(&frame_gtk->frame);