libdecor: update with upstream source code as of 2023-JUL-15

This commit is contained in:
ManoloFLTK 2023-07-22 14:23:08 +02:00
parent cdd617d094
commit fa0aa95443
4 changed files with 38 additions and 7 deletions

View File

@ -30,7 +30,7 @@ Current versions of bundled libraries (as of June 13, 2023):
nanosvg abcd277ea4 [1] 2022-12-22 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
libdecor 73260393 [2] 2023-06-06 1.4.0
libdecor f43652c7 [2] 2023-07-15 1.4.0
--------------------------------------------------------------------------
Previous versions of bundled libraries (FLTK 1.3.x):

View File

@ -16,6 +16,13 @@
/* Improvements to libdecor.c without modifying libdecor.c itself */
// this part to support libdecor commit f43652c7 dated 15-jul-2023
#include "xdg-shell-client-protocol.h"
#ifndef XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION
# define XDG_TOPLEVEL_STATE_SUSPENDED (enum xdg_toplevel_state)9
#endif
// end of this part
#define libdecor_frame_set_minimized libdecor_frame_set_minimized_orig
#define libdecor_new libdecor_new_orig
#include <dlfcn.h>

View File

@ -390,6 +390,9 @@ parse_states(struct wl_array *states)
case XDG_TOPLEVEL_STATE_TILED_BOTTOM:
pending_state |= LIBDECOR_WINDOW_STATE_TILED_BOTTOM;
break;
case XDG_TOPLEVEL_STATE_SUSPENDED:
pending_state |= LIBDECOR_WINDOW_STATE_SUSPENDED;
break;
default:
break;
}
@ -431,9 +434,26 @@ xdg_toplevel_close(void *user_data,
frame_priv->iface->close(frame, frame_priv->user_data);
}
static void
xdg_toplevel_configure_bounds(void *data,
struct xdg_toplevel *xdg_toplevel,
int32_t width,
int32_t height)
{
}
static void
xdg_toplevel_wm_capabilities(void *data,
struct xdg_toplevel *xdg_toplevel,
struct wl_array *capabilities)
{
}
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
xdg_toplevel_configure,
xdg_toplevel_close,
xdg_toplevel_configure_bounds,
xdg_toplevel_wm_capabilities,
};
static void
@ -1238,7 +1258,7 @@ init_xdg_wm_base(struct libdecor *context,
context->xdg_wm_base = wl_registry_bind(context->wl_registry,
id,
&xdg_wm_base_interface,
MIN(version,2));
MIN(version,6));
xdg_wm_base_add_listener(context->xdg_wm_base,
&xdg_wm_base_listener,
context);
@ -1389,18 +1409,21 @@ calculate_priority(const struct libdecor_plugin_description *plugin_description)
}
static bool
check_symbol_conflicts(const struct libdecor_plugin_description *plugin_description)
check_symbol_conflicts(const struct libdecor_plugin_description *plugin_description, void *lib)
{
char * const *symbol;
symbol = plugin_description->conflicting_symbols;
while (*symbol) {
dlerror();
dlsym (RTLD_DEFAULT, *symbol);
void *sym = dlsym(RTLD_DEFAULT, *symbol);
if (!dlerror()) {
fprintf(stderr, "Plugin \"%s\" uses conflicting symbol \"%s\".\n",
void *libsym = dlsym(lib, *symbol);
if (!dlerror() && libsym != sym) {
fprintf(stderr, "Plugin \"%s\" uses conflicting symbol \"%s\".\n",
plugin_description->description, *symbol);
return false;
return false;
}
}
symbol++;
@ -1460,7 +1483,7 @@ load_plugin_loader(struct libdecor *context,
return NULL;
}
if (!check_symbol_conflicts(plugin_description)) {
if (!check_symbol_conflicts(plugin_description, lib)) {
dlclose(lib);
return NULL;
}

View File

@ -81,6 +81,7 @@ enum libdecor_window_state {
LIBDECOR_WINDOW_STATE_TILED_RIGHT = 1 << 4,
LIBDECOR_WINDOW_STATE_TILED_TOP = 1 << 5,
LIBDECOR_WINDOW_STATE_TILED_BOTTOM = 1 << 6,
LIBDECOR_WINDOW_STATE_SUSPENDED = 1 << 7,
};
enum libdecor_resize_edge {