libdecor: update to upstream commit c2bd8ad6 (31-may-2024)
This commit is contained in:
parent
04949f1349
commit
5365aefc6e
@ -18,7 +18,7 @@ include ../../makeinclude
|
|||||||
|
|
||||||
OBJECTS = fl_libdecor.o libdecor-cairo-blur.o fl_libdecor-plugins.o \
|
OBJECTS = fl_libdecor.o libdecor-cairo-blur.o fl_libdecor-plugins.o \
|
||||||
../../src/xdg-decoration-protocol.o ../../src/xdg-shell-protocol.o \
|
../../src/xdg-decoration-protocol.o ../../src/xdg-shell-protocol.o \
|
||||||
../../src/text-input-protocol.o ../../src/gtk-shell-protocol.o cursor-settings.o os-compatibility.o
|
../../src/text-input-protocol.o ../../src/gtk-shell-protocol.o desktop-settings.o os-compatibility.o
|
||||||
|
|
||||||
PROTOCOLS = `pkg-config --variable=pkgdatadir wayland-protocols`
|
PROTOCOLS = `pkg-config --variable=pkgdatadir wayland-protocols`
|
||||||
|
|
||||||
@ -46,8 +46,8 @@ libdecor-cairo-blur.o : ../src/plugins/common/libdecor-cairo-blur.c
|
|||||||
os-compatibility.o : ../src/os-compatibility.c
|
os-compatibility.o : ../src/os-compatibility.c
|
||||||
$(CC) $(CFLAGS_DECOR) -c ../src/os-compatibility.c
|
$(CC) $(CFLAGS_DECOR) -c ../src/os-compatibility.c
|
||||||
|
|
||||||
cursor-settings.o : ../src/cursor-settings.c
|
desktop-settings.o : ../src/desktop-settings.c
|
||||||
$(CC) $(CFLAGS_DECOR) -c ../src/cursor-settings.c $(LIBDECORDBUS)
|
$(CC) $(CFLAGS_DECOR) -c ../src/desktop-settings.c $(LIBDECORDBUS)
|
||||||
|
|
||||||
../../src/xdg-shell-protocol.c :
|
../../src/xdg-shell-protocol.c :
|
||||||
wayland-scanner private-code $(PROTOCOLS)/stable/xdg-shell/xdg-shell.xml \
|
wayland-scanner private-code $(PROTOCOLS)/stable/xdg-shell/xdg-shell.xml \
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2019 Christian Rauch
|
* Copyright © 2019 Christian Rauch
|
||||||
|
* Copyright © 2024 Colin Kinloch
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@ -23,10 +24,11 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cursor-settings.h"
|
#include "desktop-settings.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@ -164,10 +166,48 @@ libdecor_get_cursor_settings(char **theme, int *size)
|
|||||||
fallback:
|
fallback:
|
||||||
return get_cursor_settings_from_env(theme, size);
|
return get_cursor_settings_from_env(theme, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum libdecor_color_scheme
|
||||||
|
libdecor_get_color_scheme()
|
||||||
|
{
|
||||||
|
static const char name[] = "org.freedesktop.appearance";
|
||||||
|
static const char key_color_scheme[] = "color-scheme";
|
||||||
|
uint32_t color = 0;
|
||||||
|
|
||||||
|
DBusError error;
|
||||||
|
DBusConnection *connection;
|
||||||
|
DBusMessage *reply;
|
||||||
|
|
||||||
|
dbus_error_init(&error);
|
||||||
|
|
||||||
|
connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
|
||||||
|
|
||||||
|
if (dbus_error_is_set(&error))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
reply = get_setting_sync(connection, name, key_color_scheme);
|
||||||
|
if (!reply)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!parse_type(reply, DBUS_TYPE_UINT32, &color)) {
|
||||||
|
dbus_message_unref(reply);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbus_message_unref(reply);
|
||||||
|
|
||||||
|
return color;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
bool
|
bool
|
||||||
libdecor_get_cursor_settings(char **theme, int *size)
|
libdecor_get_cursor_settings(char **theme, int *size)
|
||||||
{
|
{
|
||||||
return get_cursor_settings_from_env(theme, size);
|
return get_cursor_settings_from_env(theme, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
libdecor_get_color_scheme()
|
||||||
|
{
|
||||||
|
return LIBDECOR_COLOR_SCHEME_DEFAULT;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2019 Christian Rauch
|
* Copyright © 2019 Christian Rauch
|
||||||
|
* Copyright © 2024 Colin Kinloch
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@ -27,5 +28,14 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
enum libdecor_color_scheme {
|
||||||
|
LIBDECOR_COLOR_SCHEME_DEFAULT,
|
||||||
|
LIBDECOR_COLOR_SCHEME_PREFER_DARK,
|
||||||
|
LIBDECOR_COLOR_SCHEME_PREFER_LIGHT,
|
||||||
|
};
|
||||||
|
|
||||||
bool
|
bool
|
||||||
libdecor_get_cursor_settings(char **theme, int *size);
|
libdecor_get_cursor_settings(char **theme, int *size);
|
||||||
|
|
||||||
|
enum libdecor_color_scheme
|
||||||
|
libdecor_get_color_scheme();
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#include "libdecor-plugin.h"
|
#include "libdecor-plugin.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "cursor-settings.h"
|
#include "desktop-settings.h"
|
||||||
#include "os-compatibility.h"
|
#include "os-compatibility.h"
|
||||||
|
|
||||||
#include <cairo/cairo.h>
|
#include <cairo/cairo.h>
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#include "libdecor-plugin.h"
|
#include "libdecor-plugin.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "cursor-settings.h"
|
#include "desktop-settings.h"
|
||||||
#include "os-compatibility.h"
|
#include "os-compatibility.h"
|
||||||
|
|
||||||
#include <cairo/cairo.h>
|
#include <cairo/cairo.h>
|
||||||
@ -338,6 +338,8 @@ struct libdecor_plugin_gtk {
|
|||||||
char *cursor_theme_name;
|
char *cursor_theme_name;
|
||||||
int cursor_size;
|
int cursor_size;
|
||||||
|
|
||||||
|
uint32_t color_scheme_setting;
|
||||||
|
|
||||||
int double_click_time_ms;
|
int double_click_time_ms;
|
||||||
int drag_threshold;
|
int drag_threshold;
|
||||||
};
|
};
|
||||||
@ -2246,16 +2248,16 @@ handle_titlebar_gesture(struct libdecor_frame_gtk *frame_gtk,
|
|||||||
break;
|
break;
|
||||||
case TITLEBAR_GESTURE_MIDDLE_CLICK:
|
case TITLEBAR_GESTURE_MIDDLE_CLICK:
|
||||||
break;
|
break;
|
||||||
case TITLEBAR_GESTURE_RIGHT_CLICK: { /* FLTK */
|
case TITLEBAR_GESTURE_RIGHT_CLICK:
|
||||||
const int title_height = gtk_widget_get_allocated_height(frame_gtk->header);
|
{
|
||||||
|
const int title_height = gtk_widget_get_allocated_height(frame_gtk->header);
|
||||||
libdecor_frame_show_window_menu(&frame_gtk->frame,
|
libdecor_frame_show_window_menu(&frame_gtk->frame,
|
||||||
seat->wl_seat,
|
seat->wl_seat,
|
||||||
serial,
|
serial,
|
||||||
seat->pointer_x,
|
seat->pointer_x,
|
||||||
seat->pointer_y
|
seat->pointer_y
|
||||||
-title_height);
|
-title_height);
|
||||||
} /* FLTK */
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2410,7 +2412,7 @@ pointer_button(void *data,
|
|||||||
handle_button_on_header (frame_gtk, seat, serial, time, button, state);
|
handle_button_on_header (frame_gtk, seat, serial, time, button, state);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break; /* FLTK */
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2930,6 +2932,8 @@ libdecor_plugin_new(struct libdecor *context)
|
|||||||
plugin_gtk->cursor_size = 24;
|
plugin_gtk->cursor_size = 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin_gtk->color_scheme_setting = libdecor_get_color_scheme();
|
||||||
|
|
||||||
wl_display = libdecor_get_wl_display(context);
|
wl_display = libdecor_get_wl_display(context);
|
||||||
plugin_gtk->wl_registry = wl_display_get_registry(wl_display);
|
plugin_gtk->wl_registry = wl_display_get_registry(wl_display);
|
||||||
wl_registry_add_listener(plugin_gtk->wl_registry,
|
wl_registry_add_listener(plugin_gtk->wl_registry,
|
||||||
@ -2958,6 +2962,11 @@ libdecor_plugin_new(struct libdecor *context)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_set(gtk_settings_get_default(),
|
||||||
|
"gtk-application-prefer-dark-theme",
|
||||||
|
plugin_gtk->color_scheme_setting == LIBDECOR_COLOR_SCHEME_PREFER_DARK,
|
||||||
|
NULL);
|
||||||
|
|
||||||
return &plugin_gtk->plugin;
|
return &plugin_gtk->plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ if(FLTK_BACKEND_WAYLAND)
|
|||||||
set_source_files_properties(
|
set_source_files_properties(
|
||||||
${FLTK_SOURCE_DIR}/libdecor/build/fl_libdecor-plugins.c
|
${FLTK_SOURCE_DIR}/libdecor/build/fl_libdecor-plugins.c
|
||||||
${FLTK_SOURCE_DIR}/libdecor/src/os-compatibility.c
|
${FLTK_SOURCE_DIR}/libdecor/src/os-compatibility.c
|
||||||
${FLTK_SOURCE_DIR}/libdecor/src/cursor-settings.c
|
${FLTK_SOURCE_DIR}/libdecor/src/desktop-settings.c
|
||||||
PROPERTIES COMPILE_DEFINITIONS "${CDEFS}"
|
PROPERTIES COMPILE_DEFINITIONS "${CDEFS}"
|
||||||
INCLUDE_DIRECTORIES "${IDIRS}"
|
INCLUDE_DIRECTORIES "${IDIRS}"
|
||||||
COMPILE_OPTIONS "${COPTS}"
|
COMPILE_OPTIONS "${COPTS}"
|
||||||
@ -564,7 +564,7 @@ if(FLTK_BACKEND_WAYLAND)
|
|||||||
${FLTK_SOURCE_DIR}/libdecor/build/fl_libdecor.c
|
${FLTK_SOURCE_DIR}/libdecor/build/fl_libdecor.c
|
||||||
${FLTK_SOURCE_DIR}/libdecor/build/fl_libdecor-plugins.c
|
${FLTK_SOURCE_DIR}/libdecor/build/fl_libdecor-plugins.c
|
||||||
${FLTK_SOURCE_DIR}/libdecor/src/os-compatibility.c
|
${FLTK_SOURCE_DIR}/libdecor/src/os-compatibility.c
|
||||||
${FLTK_SOURCE_DIR}/libdecor/src/cursor-settings.c
|
${FLTK_SOURCE_DIR}/libdecor/src/desktop-settings.c
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_DEFINITIONS "${CDEFS}"
|
COMPILE_DEFINITIONS "${CDEFS}"
|
||||||
INCLUDE_DIRECTORIES "${IDIRS}"
|
INCLUDE_DIRECTORIES "${IDIRS}"
|
||||||
@ -579,7 +579,7 @@ if(FLTK_BACKEND_WAYLAND)
|
|||||||
|
|
||||||
list(APPEND CFILES
|
list(APPEND CFILES
|
||||||
scandir_posix.c
|
scandir_posix.c
|
||||||
../libdecor/src/cursor-settings.c
|
../libdecor/src/desktop-settings.c
|
||||||
../libdecor/src/os-compatibility.c
|
../libdecor/src/os-compatibility.c
|
||||||
../libdecor/build/fl_libdecor-plugins.c
|
../libdecor/build/fl_libdecor-plugins.c
|
||||||
)
|
)
|
||||||
|
@ -428,7 +428,7 @@ EXTRA_OBJECTS_WAYLAND = ../libdecor/build/fl_libdecor.o ../libdecor/build/libde
|
|||||||
../libdecor/build/fl_libdecor-plugins.o \
|
../libdecor/build/fl_libdecor-plugins.o \
|
||||||
xdg-decoration-protocol.o xdg-shell-protocol.o text-input-protocol.o \
|
xdg-decoration-protocol.o xdg-shell-protocol.o text-input-protocol.o \
|
||||||
gtk-shell-protocol.o \
|
gtk-shell-protocol.o \
|
||||||
../libdecor/build/cursor-settings.o ../libdecor/build/os-compatibility.o
|
../libdecor/build/desktop-settings.o ../libdecor/build/os-compatibility.o
|
||||||
EXTRA_OBJECTS_WAYLANDX11 = $(EXTRA_OBJECTS_WAYLAND)
|
EXTRA_OBJECTS_WAYLANDX11 = $(EXTRA_OBJECTS_WAYLAND)
|
||||||
EXTRA_CXXFLAGS_WAYLAND = -I.
|
EXTRA_CXXFLAGS_WAYLAND = -I.
|
||||||
EXTRA_CXXFLAGS_WAYLANDX11 = $(EXTRA_CXXFLAGS_WAYLAND)
|
EXTRA_CXXFLAGS_WAYLANDX11 = $(EXTRA_CXXFLAGS_WAYLAND)
|
||||||
|
Loading…
Reference in New Issue
Block a user