Borrar paquetes inactivos

This commit is contained in:
Cat /dev/Nulo 2021-10-22 21:44:43 -03:00
parent 5d1e88681e
commit 56f7ae7dde
9 changed files with 0 additions and 1272 deletions

View file

@ -1,47 +0,0 @@
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=flameshot
pkgver=0.420.420
pkgrel=0
pkgdesc="Featureful screenshot app"
options="!check" # No test suite
url="https://github.com/lupoDharkael/flameshot"
arch="all"
license="GPL-3.0-or-later"
depends="qt5-qtsvg"
makedepends="cmake qt5-qtsvg-dev qt5-qttools-dev"
subpackages="$pkgname-lang $pkgname-bash-completion $pkgname-zsh-completion $pkgname-doc"
source="$pkgname-master.tar.gz::https://github.com/lupoDharkael/flameshot/archive/master.tar.gz
"
langdir="/usr/share/flameshot/translations"
# XXX: Temporarily allow textrels on riscv64.
[ "$CARCH" = "riscv64" ] && options="$options textrels"
build() {
cd flameshot-master || true
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
$CMAKE_CROSSOPTS
make -C build
}
check() {
cd flameshot-master || true
make -C build test
}
package() {
cd src/flameshot-master || true
pwd
make -C build DESTDIR="$pkgdir" install
}
sha512sums="
97400434f940d85a3260fbbb0ffb4fc6758330c646fc26f22532def58cd9d413bac14f203df289a564c27bb5c14eaf06db4a65020138f944723d70103c3f6418 flameshot-master.tar.gz
"

View file

@ -1,28 +0,0 @@
diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c
index ce4bdc82d2..9650f4b121 100644
--- a/gdk/gdkseatdefault.c
+++ b/gdk/gdkseatdefault.c
@@ -134,22 +134,9 @@ gdk_seat_default_grab (GdkSeat *seat,
if (capabilities & GDK_SEAT_CAPABILITY_ALL_POINTING)
{
- /* ALL_POINTING spans 3 capabilities; get the mask for the ones we have */
- GdkEventMask pointer_evmask = 0;
-
- /* We let tablet styli take over the pointer cursor */
- if (capabilities & (GDK_SEAT_CAPABILITY_POINTER |
- GDK_SEAT_CAPABILITY_TABLET_STYLUS))
- {
- pointer_evmask |= POINTER_EVENTS;
- }
-
- if (capabilities & GDK_SEAT_CAPABILITY_TOUCH)
- pointer_evmask |= TOUCH_EVENTS;
-
status = gdk_device_grab (priv->master_pointer, window,
GDK_OWNERSHIP_NONE, owner_events,
- pointer_evmask, cursor,
+ POINTER_EVENTS, cursor,
evtime);
}

View file

@ -1,766 +0,0 @@
From b535e4805725eda92e86d48089457221fa8371fc Mon Sep 17 00:00:00 2001
From: Isaac Freund <ifreund@ifreund.xyz>
Date: Tue, 30 Jun 2020 00:01:02 +0200
Subject: [PATCH] wayland: Update to xdg-decoration protocol
Currently gtk uses the out of date and non-standardized
server-decoration protocol from kde. This commit replaces the
implementation of this old server-decoration protocol with an
implementation of the xdg-decoration protocol standardized in the
wayland-protocols repository.
Notable changes include:
- New private GDK API to communicate decoration state changes to GTK
- Deprecation of gdk_wayland_display_prefers_ssd(). The new protocol
doesn't provide global state, so this function is deprecated and always
returns false.
- Renaming of gdk_wayland_window_announce_ssd() to
gdk_wayland_window_request_ssd(). The server is not required to
honor requests for ssd. It is however required to honor CSD if the
xdg-decoration protocol object is destroyed. so
gdk_wayland_window_announce_csd() is still an accurate name.
---
gdk/gdk-private.c | 3 +
gdk/gdk-private.h | 17 +++
gdk/wayland/Makefile.am | 5 +-
gdk/wayland/gdkdisplay-wayland.c | 38 ++---
gdk/wayland/gdkdisplay-wayland.h | 6 +-
gdk/wayland/gdkwaylanddisplay.h | 2 +-
gdk/wayland/gdkwaylandwindow.h | 5 +-
gdk/wayland/gdkwindow-wayland.c | 160 ++++++++++++++-------
gdk/wayland/meson.build | 2 +-
gdk/wayland/protocol/server-decoration.xml | 94 ------------
gtk/gtkwindow.c | 96 +++++++++++--
11 files changed, 229 insertions(+), 199 deletions(-)
delete mode 100644 gdk/wayland/protocol/server-decoration.xml
diff --git a/gdk/gdk-private.c b/gdk/gdk-private.c
index 750edcd374..a53950460b 100644
--- a/gdk/gdk-private.c
+++ b/gdk/gdk-private.c
@@ -14,6 +14,9 @@ gdk__private__ (void)
gdk_gl_set_flags,
gdk_window_freeze_toplevel_updates,
gdk_window_thaw_toplevel_updates,
+#ifdef GDK_WINDOWING_WAYLAND
+ gdk_wayland_window_set_decoration_listener,
+#endif
gdk_display_get_rendering_mode,
gdk_display_set_rendering_mode,
gdk_display_get_debug_updates,
diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h
index c71abe4634..d7c5250dd8 100644
--- a/gdk/gdk-private.h
+++ b/gdk/gdk-private.h
@@ -23,6 +23,17 @@ void gdk_gl_set_flags (GdkGLFlags flags);
void gdk_window_freeze_toplevel_updates (GdkWindow *window);
void gdk_window_thaw_toplevel_updates (GdkWindow *window);
+#ifdef GDK_WINDOWING_WAYLAND
+typedef void (* GdkWindowDecorationNotify) (GdkWindow *window,
+ gboolean ssd,
+ void *user_data);
+
+void gdk_wayland_window_set_decoration_listener (GdkWindow *window,
+ GdkWindowDecorationNotify callback,
+ void *user_data);
+#endif
+
+
GdkRenderingMode gdk_display_get_rendering_mode (GdkDisplay *display);
void gdk_display_set_rendering_mode (GdkDisplay *display,
GdkRenderingMode mode);
@@ -52,6 +63,12 @@ typedef struct {
void (* gdk_window_freeze_toplevel_updates) (GdkWindow *window);
void (* gdk_window_thaw_toplevel_updates) (GdkWindow *window);
+#ifdef GDK_WINDOWING_WAYLAND
+ void (* gdk_wayland_window_set_decoration_listener) (GdkWindow *window,
+ GdkWindowDecorationNotify callback,
+ void *user_data);
+#endif
+
GdkRenderingMode (* gdk_display_get_rendering_mode) (GdkDisplay *display);
void (* gdk_display_set_rendering_mode) (GdkDisplay *display,
GdkRenderingMode mode);
diff --git a/gdk/wayland/Makefile.am b/gdk/wayland/Makefile.am
index 6595013d3f..878b50e545 100644
--- a/gdk/wayland/Makefile.am
+++ b/gdk/wayland/Makefile.am
@@ -37,8 +37,8 @@ BUILT_SOURCES = \
xdg-output-unstable-v1-client-protocol.h \
keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h \
keyboard-shortcuts-inhibit-unstable-v1-protocol.c \
- server-decoration-client-protocol.h \
- server-decoration-protocol.c \
+ xdg-decoration-unstable-v1-client-protocol.h \
+ xdg-decoration-unstable-v1-protocol.c \
gtk-shell-client-protocol.h \
gtk-shell-protocol.c \
primary-selection-unstable-v1-client-protocol.h \
@@ -109,7 +109,6 @@ endef
EXTRA_DIST += \
protocol/gtk-primary-selection.xml \
protocol/gtk-shell.xml \
- protocol/server-decoration.xml \
meson.build
-include $(top_srcdir)/git.mk
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index dee7632c3a..f0cd6f1248 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -47,7 +47,7 @@
#include "tablet-unstable-v2-client-protocol.h"
#include "xdg-shell-unstable-v6-client-protocol.h"
#include "xdg-foreign-unstable-v1-client-protocol.h"
-#include "server-decoration-client-protocol.h"
+#include "xdg-decoration-unstable-v1-client-protocol.h"
/**
* SECTION:wayland_interaction
@@ -354,32 +354,13 @@ static const struct wl_shm_listener wl_shm_listener = {
wl_shm_format
};
-static void
-server_decoration_manager_default_mode (void *data,
- struct org_kde_kwin_server_decoration_manager *manager,
- uint32_t mode)
-{
- g_assert (mode <= ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER);
- const char *modes[] = {
- [ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_NONE] = "none",
- [ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT] = "client",
- [ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER] = "server",
- };
- GdkWaylandDisplay *display_wayland = data;
- g_debug ("Compositor prefers decoration mode '%s'", modes[mode]);
- display_wayland->server_decoration_mode = mode;
-}
-
-static const struct org_kde_kwin_server_decoration_manager_listener server_decoration_listener = {
- .default_mode = server_decoration_manager_default_mode
-};
-
gboolean
gdk_wayland_display_prefers_ssd (GdkDisplay *display)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
- if (display_wayland->server_decoration_manager)
- return display_wayland->server_decoration_mode == ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER;
+ /* If the server doesn't implement xdg-decoration, we will just client-side
+ * decorate. If the server does implement xdg-decoration, we will initially
+ * client-side decorate and possibly negotiate a change to server-side
+ * decorations. This function is deprecated as it is no longer useful. */
return FALSE;
}
@@ -503,14 +484,11 @@ gdk_registry_handle_global (void *data,
wl_registry_bind (display_wayland->wl_registry, id,
&zwp_keyboard_shortcuts_inhibit_manager_v1_interface, 1);
}
- else if (strcmp (interface, "org_kde_kwin_server_decoration_manager") == 0)
+ else if (strcmp (interface, "zxdg_decoration_manager_v1") == 0)
{
- display_wayland->server_decoration_manager =
+ display_wayland->xdg_decoration_manager =
wl_registry_bind (display_wayland->wl_registry, id,
- &org_kde_kwin_server_decoration_manager_interface, 1);
- org_kde_kwin_server_decoration_manager_add_listener (display_wayland->server_decoration_manager,
- &server_decoration_listener,
- display_wayland);
+ &zxdg_decoration_manager_v1_interface, 1);
}
else if (strcmp(interface, "zxdg_output_manager_v1") == 0)
{
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index 62696300d1..2f4381de80 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -33,7 +33,7 @@
#include <gdk/wayland/xdg-shell-unstable-v6-client-protocol.h>
#include <gdk/wayland/xdg-foreign-unstable-v1-client-protocol.h>
#include <gdk/wayland/keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h>
-#include <gdk/wayland/server-decoration-client-protocol.h>
+#include <gdk/wayland/xdg-decoration-unstable-v1-client-protocol.h>
#include <gdk/wayland/xdg-output-unstable-v1-client-protocol.h>
#include <gdk/wayland/primary-selection-unstable-v1-client-protocol.h>
@@ -95,7 +95,7 @@ struct _GdkWaylandDisplay
struct zxdg_exporter_v1 *xdg_exporter;
struct zxdg_importer_v1 *xdg_importer;
struct zwp_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
- struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
+ struct zxdg_decoration_manager_v1 *xdg_decoration_manager;
struct zxdg_output_manager_v1 *xdg_output_manager;
uint32_t xdg_output_version;
@@ -126,8 +126,6 @@ struct _GdkWaylandDisplay
int gtk_shell_version;
int xdg_output_manager_version;
- uint32_t server_decoration_mode;
-
struct xkb_context *xkb_context;
GdkWaylandSelection *selection;
diff --git a/gdk/wayland/gdkwaylanddisplay.h b/gdk/wayland/gdkwaylanddisplay.h
index af9cc896be..d7f40e8757 100644
--- a/gdk/wayland/gdkwaylanddisplay.h
+++ b/gdk/wayland/gdkwaylanddisplay.h
@@ -57,7 +57,7 @@ GDK_AVAILABLE_IN_3_22
void gdk_wayland_display_set_startup_notification_id (GdkDisplay *display,
const char *startup_id);
-GDK_AVAILABLE_IN_3_22
+GDK_DEPRECATED_IN_3_24
gboolean gdk_wayland_display_prefers_ssd (GdkDisplay *display);
GDK_AVAILABLE_IN_3_22
diff --git a/gdk/wayland/gdkwaylandwindow.h b/gdk/wayland/gdkwaylandwindow.h
index b8a8a02243..6a9b37881b 100644
--- a/gdk/wayland/gdkwaylandwindow.h
+++ b/gdk/wayland/gdkwaylandwindow.h
@@ -84,9 +84,12 @@ void gdk_wayland_window_set_application_id (GdkWindow *windo
GDK_AVAILABLE_IN_3_22
void gdk_wayland_window_announce_csd (GdkWindow *window);
-GDK_AVAILABLE_IN_3_24
+GDK_DEPRECATED_IN_3_24_FOR(gdk_wayland_window_request_ssd)
void gdk_wayland_window_announce_ssd (GdkWindow *window);
+GDK_AVAILABLE_IN_3_24
+void gdk_wayland_window_request_ssd (GdkWindow *window);
+
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_add_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface);
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 2d7c42bd7a..44b9440c19 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -28,6 +28,7 @@
#include "gdkdisplay-wayland.h"
#include "gdkglcontext-wayland.h"
#include "gdkframeclockprivate.h"
+#include "gdk-private.h"
#include "gdkprivate-wayland.h"
#include "gdkprofilerprivate.h"
#include "gdkinternals.h"
@@ -123,6 +124,7 @@ struct _GdkWindowImplWayland
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
struct xdg_popup *xdg_popup;
+ struct zxdg_toplevel_decoration_v1 *xdg_toplevel_decoration;
/* Legacy xdg-shell unstable v6 fallback support */
struct zxdg_surface_v6 *zxdg_surface_v6;
@@ -134,7 +136,6 @@ struct _GdkWindowImplWayland
struct wl_egl_window *egl_window;
struct wl_egl_window *dummy_egl_window;
struct zxdg_exported_v1 *xdg_exported;
- struct org_kde_kwin_server_decoration *server_decoration;
} display_server;
EGLSurface egl_surface;
@@ -239,6 +240,12 @@ struct _GdkWindowImplWayland
struct wl_callback *surface_callback;
GHashTable *frame_callback_surfaces;
+
+ struct {
+ gboolean ssd;
+ GdkWindowDecorationNotify callback;
+ void *user_data;
+ } decoration_listener;
};
struct _GdkWindowImplWaylandClass
@@ -274,7 +281,6 @@ static void calculate_moved_to_rect_result (GdkWindow *window,
static gboolean gdk_wayland_window_is_exported (GdkWindow *window);
static void gdk_wayland_window_unexport (GdkWindow *window);
-static void gdk_wayland_window_announce_decoration_mode (GdkWindow *window);
static gboolean should_map_as_subsurface (GdkWindow *window);
static gboolean should_map_as_popup (GdkWindow *window);
@@ -1877,6 +1883,68 @@ static const struct xdg_toplevel_listener xdg_toplevel_listener = {
xdg_toplevel_close,
};
+static void
+call_decoration_listener_callback (GdkWindow *window)
+{
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+ if (impl->decoration_listener.callback)
+ impl->decoration_listener.callback (window,
+ impl->decoration_listener.ssd,
+ impl->decoration_listener.user_data);
+}
+
+static void
+xdg_toplevel_decoration_configure (void *data,
+ struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
+ uint32_t mode)
+{
+ GdkWindow *window = GDK_WINDOW (data);
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+ if (mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE)
+ {
+ if (!impl->decoration_listener.ssd)
+ {
+ impl->decoration_listener.ssd = TRUE;
+ call_decoration_listener_callback (window);
+ }
+ }
+ else if (mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE)
+ {
+ if (impl->decoration_listener.ssd)
+ {
+ impl->decoration_listener.ssd = FALSE;
+ call_decoration_listener_callback (window);
+ }
+ }
+ else
+ g_assert_not_reached ();
+}
+
+static const struct zxdg_toplevel_decoration_v1_listener xdg_toplevel_decoration_listener = {
+ xdg_toplevel_decoration_configure,
+};
+
+static void
+create_xdg_toplevel_decoration (GdkWindow *window)
+{
+ GdkWaylandDisplay *display_wayland =
+ GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+ if (display_wayland->xdg_decoration_manager)
+ {
+ impl->display_server.xdg_toplevel_decoration =
+ zxdg_decoration_manager_v1_get_toplevel_decoration (display_wayland->xdg_decoration_manager,
+ impl->display_server.xdg_toplevel);
+ zxdg_toplevel_decoration_v1_add_listener (impl->display_server.xdg_toplevel_decoration,
+ &xdg_toplevel_decoration_listener,
+ window);
+ zxdg_toplevel_decoration_v1_unset_mode (impl->display_server.xdg_toplevel_decoration);
+ }
+}
+
static void
create_xdg_toplevel_resources (GdkWindow *window)
{
@@ -1896,6 +1964,8 @@ create_xdg_toplevel_resources (GdkWindow *window)
xdg_toplevel_add_listener (impl->display_server.xdg_toplevel,
&xdg_toplevel_listener,
window);
+
+ create_xdg_toplevel_decoration(window);
}
static void
@@ -2299,68 +2369,58 @@ window_anchor_to_gravity_legacy (GdkGravity rect_anchor)
}
}
-static void
-kwin_server_decoration_mode_set (void *data, struct org_kde_kwin_server_decoration *org_kde_kwin_server_decoration, uint32_t mode)
+void
+gdk_wayland_window_request_ssd (GdkWindow *window)
{
- GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- if ((mode == ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER && impl->using_csd) ||
- (mode == ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT && !impl->using_csd))
- gdk_wayland_window_announce_decoration_mode (window);
-}
+ /* This may have been destroyed in gdk_wayland_window_announce_csd()
+ * so create it again if needed. */
+ if (!impl->display_server.xdg_toplevel_decoration)
+ create_xdg_toplevel_decoration(window);
-static const struct org_kde_kwin_server_decoration_listener kwin_server_decoration_listener = {
- kwin_server_decoration_mode_set
-};
+ if (impl->display_server.xdg_toplevel_decoration)
+ zxdg_toplevel_decoration_v1_set_mode (impl->display_server.xdg_toplevel_decoration,
+ ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
+}
-static void
-gdk_wayland_window_announce_decoration_mode (GdkWindow *window)
+void
+gdk_wayland_window_announce_csd (GdkWindow *window)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- if (!display_wayland->server_decoration_manager)
- return;
- if (!impl->display_server.server_decoration)
+ if (impl->display_server.xdg_toplevel_decoration)
{
- impl->display_server.server_decoration =
- org_kde_kwin_server_decoration_manager_create (display_wayland->server_decoration_manager,
- impl->display_server.wl_surface);
- org_kde_kwin_server_decoration_add_listener (impl->display_server.server_decoration,
- &kwin_server_decoration_listener,
- window);
- }
+ zxdg_toplevel_decoration_v1_destroy(impl->display_server.xdg_toplevel_decoration);
+ impl->display_server.xdg_toplevel_decoration = NULL;
+ }
- if (impl->display_server.server_decoration)
+ if (impl->decoration_listener.ssd)
{
- if (impl->using_csd)
- org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
- ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT);
- else
- org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
- ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER);
+ impl->decoration_listener.ssd = FALSE;
+ call_decoration_listener_callback(window);
}
}
void
-gdk_wayland_window_announce_csd (GdkWindow *window)
+gdk_wayland_window_announce_ssd (GdkWindow *window)
{
- GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
-
- impl->using_csd = TRUE;
- if (impl->mapped)
- gdk_wayland_window_announce_decoration_mode (window);
+ /* deprecated as this no is no longer an annoncement but a request */
+ gdk_wayland_window_request_ssd (window);
}
-void
-gdk_wayland_window_announce_ssd (GdkWindow *window)
+void gdk_wayland_window_set_decoration_listener (GdkWindow *window,
+ GdkWindowDecorationNotify callback,
+ void *user_data)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- impl->using_csd = FALSE;
- if (impl->mapped)
- gdk_wayland_window_announce_decoration_mode (window);
+ /* Don't support changing the callback once set. This is a private API
+ * and such complexity is not currently needed. */
+ g_assert(impl->decoration_listener.callback == NULL);
+
+ impl->decoration_listener.callback = callback;
+ impl->decoration_listener.user_data = user_data;
}
static GdkWindow *
@@ -3213,13 +3273,11 @@ gdk_wayland_window_map (GdkWindow *window)
else
{
gdk_wayland_window_create_xdg_toplevel (window);
- gdk_wayland_window_announce_decoration_mode (window);
}
}
else
{
gdk_wayland_window_create_xdg_toplevel (window);
- gdk_wayland_window_announce_decoration_mode (window);
}
impl->mapped = TRUE;
@@ -3321,6 +3379,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
if (impl->display_server.xdg_toplevel)
{
+ if (impl->display_server.xdg_toplevel_decoration)
+ {
+ zxdg_toplevel_decoration_v1_destroy (impl->display_server.xdg_toplevel_decoration);
+ impl->display_server.xdg_toplevel_decoration = NULL;
+ }
+
xdg_toplevel_destroy (impl->display_server.xdg_toplevel);
impl->display_server.xdg_toplevel = NULL;
}
@@ -3387,12 +3451,6 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
impl->application.was_set = FALSE;
}
- if (impl->display_server.server_decoration)
- {
- org_kde_kwin_server_decoration_release (impl->display_server.server_decoration);
- impl->display_server.server_decoration = NULL;
- }
-
wl_surface_destroy (impl->display_server.wl_surface);
impl->display_server.wl_surface = NULL;
impl->surface_callback = NULL;
diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build
index e66afd7f95..e4906d3641 100644
--- a/gdk/wayland/meson.build
+++ b/gdk/wayland/meson.build
@@ -54,7 +54,7 @@ proto_sources = [
['xdg-foreign', 'unstable', 'v1', ],
['tablet', 'unstable', 'v2', ],
['keyboard-shortcuts-inhibit', 'unstable', 'v1', ],
- ['server-decoration', 'private' ],
+ ['xdg-decoration', 'unstable', 'v1', ],
['xdg-output', 'unstable', 'v1', ],
['primary-selection', 'unstable', 'v1', ],
]
diff --git a/gdk/wayland/protocol/server-decoration.xml b/gdk/wayland/protocol/server-decoration.xml
deleted file mode 100644
index 8bc106c7c4..0000000000
--- a/gdk/wayland/protocol/server-decoration.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="server_decoration">
- <copyright><![CDATA[
- Copyright (C) 2015 Martin Gräßlin
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 2.1 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- ]]></copyright>
- <interface name="org_kde_kwin_server_decoration_manager" version="1">
- <description summary="Server side window decoration manager">
- This interface allows to coordinate whether the server should create
- a server-side window decoration around a wl_surface representing a
- shell surface (wl_shell_surface or similar). By announcing support
- for this interface the server indicates that it supports server
- side decorations.
- </description>
- <request name="create">
- <description summary="Create a server-side decoration object for a given surface">
- When a client creates a server-side decoration object it indicates
- that it supports the protocol. The client is supposed to tell the
- server whether it wants server-side decorations or will provide
- client-side decorations.
-
- If the client does not create a server-side decoration object for
- a surface the server interprets this as lack of support for this
- protocol and considers it as client-side decorated. Nevertheless a
- client-side decorated surface should use this protocol to indicate
- to the server that it does not want a server-side deco.
- </description>
- <arg name="id" type="new_id" interface="org_kde_kwin_server_decoration"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
- <enum name="mode">
- <description summary="Possible values to use in request_mode and the event mode."/>
- <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/>
- <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/>
- <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/>
- </enum>
- <event name="default_mode">
- <description summary="The default mode used on the server">
- This event is emitted directly after binding the interface. It contains
- the default mode for the decoration. When a new server decoration object
- is created this new object will be in the default mode until the first
- request_mode is requested.
-
- The server may change the default mode at any time.
- </description>
- <arg name="mode" type="uint" summary="The default decoration mode applied to newly created server decorations."/>
- </event>
- </interface>
- <interface name="org_kde_kwin_server_decoration" version="1">
- <request name="release" type="destructor">
- <description summary="release the server decoration object"/>
- </request>
- <enum name="mode">
- <description summary="Possible values to use in request_mode and the event mode."/>
- <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/>
- <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/>
- <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/>
- </enum>
- <request name="request_mode">
- <description summary="The decoration mode the surface wants to use."/>
- <arg name="mode" type="uint" summary="The mode this surface wants to use."/>
- </request>
- <event name="mode">
- <description summary="The new decoration mode applied by the server">
- This event is emitted directly after the decoration is created and
- represents the base decoration policy by the server. E.g. a server
- which wants all surfaces to be client-side decorated will send Client,
- a server which wants server-side decoration will send Server.
-
- The client can request a different mode through the decoration request.
- The server will acknowledge this by another event with the same mode. So
- even if a server prefers server-side decoration it's possible to force a
- client-side decoration.
-
- The server may emit this event at any time. In this case the client can
- again request a different mode. It's the responsibility of the server to
- prevent a feedback loop.
- </description>
- <arg name="mode" type="uint" summary="The decoration mode applied to the surface by the server."/>
- </event>
- </interface>
-</protocol>
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index d9c456e304..4bf49580eb 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4166,6 +4166,19 @@ gtk_window_enable_csd (GtkWindow *window)
priv->client_decorated = TRUE;
}
+static void
+gtk_window_disable_csd (GtkWindow *window)
+{
+ GtkWindowPrivate *priv = window->priv;
+ GtkWidget *widget = GTK_WIDGET (window);
+
+ /* Only one of these will actually be set, but removing both is harmless */
+ gtk_style_context_remove_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
+ gtk_style_context_remove_class (gtk_widget_get_style_context (widget), "solid-csd");
+
+ priv->client_decorated = FALSE;
+}
+
static void
on_titlebar_title_notify (GtkHeaderBar *titlebar,
GParamSpec *pspec,
@@ -6119,10 +6132,7 @@ gtk_window_should_use_csd (GtkWindow *window)
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
- {
- GdkDisplay *gdk_display = gtk_widget_get_display (GTK_WIDGET (window));
- return !gdk_wayland_display_prefers_ssd (gdk_display);
- }
+ return TRUE;
#endif
#ifdef GDK_WINDOWING_WIN32
@@ -6156,6 +6166,31 @@ create_decoration (GtkWidget *widget)
gtk_widget_show_all (priv->titlebar);
priv->title_box = priv->titlebar;
}
+ else if (priv->title_box == priv->titlebar)
+ gtk_widget_show_all (priv->title_box);
+
+ update_window_buttons (window);
+}
+
+static void update_shadow_width (GtkWindow *window, GtkBorder *border);
+
+static void
+destroy_decoration (GtkWidget *widget)
+{
+ GtkWindow *window = GTK_WINDOW (widget);
+ GtkWindowPrivate *priv = window->priv;
+ GtkBorder border = {0};
+
+ priv->use_client_shadow = FALSE;
+ update_shadow_width(window, &border);
+
+ gtk_window_disable_csd (window);
+
+ if (priv->type == GTK_WINDOW_POPUP)
+ return;
+
+ if (priv->title_box == priv->titlebar)
+ gtk_widget_hide (priv->title_box);
update_window_buttons (window);
}
@@ -7347,6 +7382,42 @@ update_realized_window_properties (GtkWindow *window,
update_border_windows (window);
}
+static void
+handle_decoration_state_change (GtkWidget *widget)
+{
+ GtkAllocation allocation;
+ GdkWindow *window = gtk_widget_get_window (widget);
+
+ allocation.x = 0;
+ allocation.y = 0;
+ allocation.width = gdk_window_get_width (window);
+ allocation.height = gdk_window_get_height (window);
+
+ gtk_widget_size_allocate (widget, &allocation);
+ gtk_widget_queue_resize (widget);
+}
+
+static void
+wayland_handle_decoration (GdkWindow *gdk_window,
+ gboolean ssd,
+ void *user_data)
+{
+ GtkWidget *widget = user_data;
+ GtkWindow *window = GTK_WINDOW (widget);
+ GtkWindowPrivate *priv = window->priv;
+
+ if (priv->client_decorated && ssd)
+ {
+ destroy_decoration(widget);
+ handle_decoration_state_change(widget);
+ }
+ else if (!priv->client_decorated && !ssd)
+ {
+ create_decoration(widget);
+ handle_decoration_state_change(widget);
+ }
+}
+
static void
gtk_window_realize (GtkWidget *widget)
{
@@ -7544,16 +7615,6 @@ gtk_window_realize (GtkWidget *widget)
if (!priv->decorated || priv->client_decorated)
gdk_window_set_decorations (gdk_window, 0);
-#ifdef GDK_WINDOWING_WAYLAND
- if (GDK_IS_WAYLAND_WINDOW (gdk_window))
- {
- if (priv->client_decorated)
- gdk_wayland_window_announce_csd (gdk_window);
- else
- gdk_wayland_window_announce_ssd (gdk_window);
- }
-#endif
-
if (!priv->deletable)
gdk_window_set_functions (gdk_window, GDK_FUNC_ALL | GDK_FUNC_CLOSE);
@@ -7600,6 +7661,13 @@ gtk_window_realize (GtkWidget *widget)
}
#endif
+#ifdef GDK_WINDOWING_WAYLAND
+ if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget)))
+ GDK_PRIVATE_CALL (gdk_wayland_window_set_decoration_listener) (gdk_window,
+ wayland_handle_decoration,
+ widget);
+#endif
+
child_allocation.x = 0;
child_allocation.y = 0;
child_allocation.width = allocation.width;
--
GitLab

View file

@ -1,91 +0,0 @@
From 72ab4c46edbcbbf8985f42f5f0cee1b799ce5a91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Wed, 26 May 2021 17:08:03 +0200
Subject: [PATCH] gtkapplication-dbus: Fetch inital screen saver state async
Avoid a sync call that can make the application block for no good
reason.
Fixes 6f6b5faaa216feed666b659d1cdfacd0c5c393d9
---
gtk/gtkapplication-dbus.c | 54 +++++++++++++++++++++++----------------
1 file changed, 32 insertions(+), 22 deletions(-)
diff --git a/gtk/gtkapplication-dbus.c b/gtk/gtkapplication-dbus.c
index a270354119..4951b1f558 100644
--- a/gtk/gtkapplication-dbus.c
+++ b/gtk/gtkapplication-dbus.c
@@ -227,6 +227,30 @@ screensaver_signal_portal (GDBusConnection *connection,
}
}
+static void
+ss_get_active_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer data)
+{
+ GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) data;
+ GDBusProxy *proxy = G_DBUS_PROXY (source);
+ GError *error = NULL;
+ GVariant *ret;
+ gboolean active;
+
+ ret = g_dbus_proxy_call_finish (proxy, result, &error);
+ if (ret == NULL)
+ {
+ g_warning ("Getting screensaver status failed: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ g_variant_get (ret, "(b)", &active);
+ g_variant_unref (ret);
+ gtk_application_set_screensaver_active (dbus->impl.application, active);
+}
+
static void
create_monitor_cb (GObject *source,
GAsyncResult *result,
@@ -329,31 +353,17 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
if (dbus->ss_proxy)
{
- GVariant *active_var;
- gboolean active;
-
g_signal_connect (dbus->ss_proxy, "g-signal",
G_CALLBACK (screensaver_signal_session), impl->application);
- active_var = g_dbus_proxy_call_sync (dbus->ss_proxy,
- "GetActive",
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- NULL,
- &error);
- if (!active_var)
- {
- g_debug ("Error calling GetActive on GNOME screensaver: %s",
- error->message);
- g_clear_error (&error);
- }
- else
- {
- g_variant_get (active_var, "(b)", &active);
- g_variant_unref (active_var);
- gtk_application_set_screensaver_active (dbus->impl.application, active);
- }
+ g_dbus_proxy_call (dbus->ss_proxy,
+ "GetActive",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ NULL,
+ ss_get_active_cb,
+ dbus);
}
g_debug ("Registering client '%s' '%s'", dbus->application_id, client_id);
--
GitLab

View file

@ -1,129 +0,0 @@
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gtk+3.0-xdg-decoration
pkgver=3.24.28
pkgrel=1
pkgdesc="The GTK+ Toolkit (v3)"
url="https://www.gtk.org/"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.post-deinstall"
arch="all"
license="LGPL-2.1-or-later"
options="!check" # Most glade tests fail :c
subpackages="$pkgname-demo $pkgname-dev $pkgname-doc $pkgname-lang $pkgname-dbg"
depends="shared-mime-info gtk-update-icon-cache"
replaces="gtk+"
depends_dev="
atk-dev
gdk-pixbuf-dev
glib-dev
libepoxy-dev
libxext-dev
libxi-dev
libxinerama-dev
wayland-protocols
wayland-libs-client
wayland-libs-cursor
libxkbcommon-dev
"
makedepends="
$depends_dev
cups-dev
expat-dev
gettext-dev
gobject-introspection-dev
libice-dev
tiff-dev
zlib-dev
at-spi2-atk-dev
cairo-dev
fontconfig-dev
pango-dev
wayland-dev
libx11-dev
libxcomposite-dev
libxcursor-dev
libxdamage-dev
libxfixes-dev
libxrandr-dev
meson
gtk-doc
iso-codes-dev
"
checkdepends="
xvfb-run
ibus
librsvg
gdk-pixbuf
"
source="https://download.gnome.org/sources/gtk+/${pkgver%.*}/gtk+-$pkgver.tar.xz
10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch
3614.patch
2191.patch
check-version.py
"
builddir="$srcdir/gtk+-$pkgver"
prepare() {
default_prepare
# Upstream forgot to include this in the tarball
# https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1776
mv "$srcdir"/check-version.py .
}
build() {
abuild-meson \
-Dman=true \
-Dgtk_doc=false \
-Dbroadway_backend=true \
output
meson compile ${JOBS:+-j ${JOBS}} -C output
}
check() {
xvfb-run meson test --no-rebuild -v -C output
}
package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C output
# use gtk-update-icon-cache from gtk+2.0 for now
rm -f "$pkgdir"/usr/bin/gtk-update-icon-cache
rm -f "$pkgdir"/usr/share/man/man1/gtk-update-icon-cache.1
}
demo() {
pkgdesc="$pkgdesc (demonstration application)"
amove usr/bin/gtk3-demo \
usr/bin/gtk3-widget-factory \
usr/bin/gtk3-demo-application
amove usr/share/gtk-3.0/gtkbuilder.rng \
usr/share/glib-2.0/schemas/org.gtk.Demo.gschema.xml \
usr/share/applications/gtk3-widget-factory.desktop \
usr/share/applications/gtk3-demo.desktop
amove usr/share/icons
}
dev() {
replaces="gtk+-dev"
default_dev
}
doc() {
replaces="gtk+-doc"
default_doc
}
sha512sums="
65856ae06e4a863c56b3718c0cc3d0ca9f61a62a02ddef30904432300cd455851efee3fa1e5661659eaacbdfca45650ee7c8a2d4eca004ad2936c1e26c720c15 gtk+-3.24.28.tar.xz
e4ea76484b70bd9beb65b2964bbcff3b3f78f5f6fe70b12309a7721ca134e3735e8aaac09803f93b393a6130a703f8f346c0df89ad45d18c580dac1e0e922276 10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch
0f166e3db57d4abbf6c540f09ca32c9f52fe02634c32b0808cd863824cfd1607877fcaff54299605b834c43ecb4bc4a02c0ccfaed02ed728b728523fe385d054 3614.patch
0237c3ff79e5ae46325abfc1635822437162dac88a116092b5c048e03a5b703e75c56f1e7e0898b8878e32767b98f81d91ab86b676181a3be503402fc38df46d 2191.patch
b97ccd8fb78d7c32fe91607befd6a7c0dd969fbfc9c242948fc88085133e3461583a0b18ade199b73f9659cae5f5525b940e66535a6ced4b916af9a88b3cc578 check-version.py
"

View file

@ -1,200 +0,0 @@
#!/usr/bin/env python3
import re
import sys
try:
configure_ac = sys.argv[1]
except Exception:
configure_ac = 'configure.ac'
try:
meson_build = sys.argv[2]
except Exception:
meson_build = 'meson.build'
CONFIGURE_MAJOR_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_major_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_MINOR_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_minor_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_MICRO_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_micro_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_INTERFACE_AGE_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_interface_age\]
\s*
,
\s*
\[
(?P<age>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
MESON_VERSION_RE = re.compile(
r'''
^
\s*
version
\s*
:{1}
\s*
\'{1}
(?P<major>[0-9]+)
\.{1}
(?P<minor>[0-9]+)
\.{1}
(?P<micro>[0-9]+)
\'{1}
\s*
,?
$
''',
re.UNICODE | re.VERBOSE
)
MESON_INTERFACE_AGE_RE = re.compile(
r'''
^\s*gtk_interface_age\s*={1}\s*(?P<age>[0-9]+)\s*$
''',
re.UNICODE | re.VERBOSE
)
version = {}
with open(configure_ac, 'r') as f:
line = f.readline()
while line:
res = CONFIGURE_MAJOR_VERSION_RE.match(line)
if res:
if 'major' in version:
print(f'Redefinition of major version; version is already set to {version["major"]}')
sys.exit(1)
version['major'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_MINOR_VERSION_RE.match(line)
if res:
if 'minor' in version:
print(f'Redefinition of minor version; version is already set to {version["minor"]}')
sys.exit(1)
version['minor'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_MICRO_VERSION_RE.match(line)
if res:
if 'micro' in version:
print(f'Redefinition of micro version; version is already set to {version["micro"]}')
sys.exit(1)
version['micro'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_INTERFACE_AGE_RE.match(line)
if res:
if 'age' in version:
print(f'Redefinition of interface age; age is already set to {version["age"]}')
sys.exit(1)
version['age'] = res.group('age')
line = f.readline()
continue
if ('major', 'minor', 'micro', 'age') in version:
break
line = f.readline()
print(f'GTK version defined in {configure_ac}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
configure_version = version
version = {}
with open(meson_build, 'r') as f:
line = f.readline()
inside_project = False
while line:
if line.startswith('project('):
inside_project = True
if inside_project:
res = MESON_VERSION_RE.match(line)
if res:
version['major'] = res.group('major')
version['minor'] = res.group('minor')
version['micro'] = res.group('micro')
if inside_project and line.endswith(')'):
inside_project = False
res = MESON_INTERFACE_AGE_RE.match(line)
if res:
version['age'] = res.group('age')
if ('major', 'minor', 'micro', 'age') in version:
break
line = f.readline()
print(f'GTK version defined in {meson_build}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
meson_version = version
if configure_version != meson_version:
print('Version mismatch between Autotools and Meson builds')
sys.exit(1)
sys.exit(0)

View file

@ -1,5 +0,0 @@
#!/bin/sh
rm -f etc/gtk-3.0/gtk.immodules
rm -f etc/gtk-3.0/gdk-pixbuf.loaders

View file

@ -1,5 +0,0 @@
#!/bin/sh
usr/bin/gtk-query-immodules-3.0 > etc/gtk-3.0/gtk.immodules
usr/bin/gdk-pixbuf-query-loaders > etc/gtk-3.0/gdk-pixbuf.loaders

View file

@ -1 +0,0 @@
gtk+3.0-xdg-decoration.post-install