mirror of
https://github.com/fltk/fltk.git
synced 2026-05-25 17:42:14 +08:00
libdecor: update with upstream source code as of 2023-may-26
This commit is contained in:
@@ -398,12 +398,15 @@ libdecor_plugin_cairo_destroy(struct libdecor_plugin *plugin)
|
||||
|
||||
free(plugin_cairo->cursor_theme_name);
|
||||
|
||||
wl_shm_destroy(plugin_cairo->wl_shm);
|
||||
if (plugin_cairo->wl_shm)
|
||||
wl_shm_destroy(plugin_cairo->wl_shm);
|
||||
|
||||
pango_font_description_free(plugin_cairo->font);
|
||||
|
||||
wl_compositor_destroy(plugin_cairo->wl_compositor);
|
||||
wl_subcompositor_destroy(plugin_cairo->wl_subcompositor);
|
||||
if (plugin_cairo->wl_compositor)
|
||||
wl_compositor_destroy(plugin_cairo->wl_compositor);
|
||||
if (plugin_cairo->wl_subcompositor)
|
||||
wl_subcompositor_destroy(plugin_cairo->wl_subcompositor);
|
||||
|
||||
libdecor_plugin_release(&plugin_cairo->plugin);
|
||||
free(plugin_cairo);
|
||||
@@ -2679,13 +2682,6 @@ globals_callback(void *user_data,
|
||||
|
||||
wl_callback_destroy(callback);
|
||||
plugin_cairo->globals_callback = NULL;
|
||||
|
||||
if (!has_required_globals(plugin_cairo)) {
|
||||
libdecor_notify_plugin_error(
|
||||
plugin_cairo->context,
|
||||
LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE,
|
||||
"Compositor is missing required globals");
|
||||
}
|
||||
}
|
||||
|
||||
static const struct wl_callback_listener globals_callback_listener = {
|
||||
@@ -2731,6 +2727,13 @@ libdecor_plugin_new(struct libdecor *context)
|
||||
wl_callback_add_listener(plugin_cairo->globals_callback,
|
||||
&globals_callback_listener,
|
||||
plugin_cairo);
|
||||
wl_display_roundtrip(wl_display);
|
||||
|
||||
if (!has_required_globals(plugin_cairo)) {
|
||||
fprintf(stderr, "libdecor-cairo-WARNING: Could not get required globals\n");
|
||||
libdecor_plugin_cairo_destroy(&plugin_cairo->plugin);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &plugin_cairo->plugin;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <wayland-client-core.h>
|
||||
#include <wayland-cursor.h>
|
||||
|
||||
#include "libdecor-plugin.h"
|
||||
@@ -427,10 +428,13 @@ libdecor_plugin_gtk_destroy(struct libdecor_plugin *plugin)
|
||||
|
||||
free(plugin_gtk->cursor_theme_name);
|
||||
|
||||
wl_shm_destroy(plugin_gtk->wl_shm);
|
||||
if (plugin_gtk->wl_shm)
|
||||
wl_shm_destroy(plugin_gtk->wl_shm);
|
||||
|
||||
wl_compositor_destroy(plugin_gtk->wl_compositor);
|
||||
wl_subcompositor_destroy(plugin_gtk->wl_subcompositor);
|
||||
if (plugin_gtk->wl_compositor)
|
||||
wl_compositor_destroy(plugin_gtk->wl_compositor);
|
||||
if (plugin_gtk->wl_subcompositor)
|
||||
wl_subcompositor_destroy(plugin_gtk->wl_subcompositor);
|
||||
|
||||
|
||||
free(plugin_gtk);
|
||||
@@ -2100,6 +2104,7 @@ pointer_leave(void *data,
|
||||
if (frame_gtk) {
|
||||
frame_gtk->active = NULL;
|
||||
frame_gtk->hdr_focus.widget = NULL;
|
||||
frame_gtk->hdr_focus.type = HEADER_NONE;
|
||||
draw_decoration(frame_gtk);
|
||||
libdecor_frame_toplevel_commit(&frame_gtk->frame);
|
||||
update_local_cursor(seat);
|
||||
@@ -2532,15 +2537,6 @@ globals_callback(void *user_data,
|
||||
|
||||
wl_callback_destroy(callback);
|
||||
plugin_gtk->globals_callback = NULL;
|
||||
|
||||
if (!has_required_globals(plugin_gtk)) {
|
||||
struct libdecor *context = plugin_gtk->context;
|
||||
|
||||
libdecor_notify_plugin_error(
|
||||
context,
|
||||
LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE,
|
||||
"Compositor is missing required globals");
|
||||
}
|
||||
}
|
||||
|
||||
static const struct wl_callback_listener globals_callback_listener = {
|
||||
@@ -2580,6 +2576,13 @@ libdecor_plugin_new(struct libdecor *context)
|
||||
wl_callback_add_listener(plugin_gtk->globals_callback,
|
||||
&globals_callback_listener,
|
||||
plugin_gtk);
|
||||
wl_display_roundtrip(wl_display);
|
||||
|
||||
if (!has_required_globals(plugin_gtk)) {
|
||||
fprintf(stderr, "libdecor-gtk-WARNING: Could not get required globals\n");
|
||||
libdecor_plugin_gtk_destroy(&plugin_gtk->plugin);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* setup GTK context */
|
||||
gdk_set_allowed_backends("wayland");
|
||||
|
||||
Reference in New Issue
Block a user