This commit is contained in:
Cat /dev/Nulo 2021-10-22 21:43:11 -03:00
commit 5d1e88681e
19 changed files with 1769 additions and 0 deletions

6
build-all.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
for f in *; do
test -d "$f" || continue
./build.sh "$f"
done

6
build.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
set -e
cd "$1"
abuild -r

47
flameshot/APKBUILD Normal file
View file

@ -0,0 +1,47 @@
# 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

@ -0,0 +1,28 @@
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

@ -0,0 +1,766 @@
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

@ -0,0 +1,91 @@
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

@ -0,0 +1,129 @@
# 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

@ -0,0 +1,200 @@
#!/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

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

View file

@ -0,0 +1,5 @@
#!/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

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

77
mandoc/APKBUILD Normal file
View file

@ -0,0 +1,77 @@
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mandoc
pkgver=1.14.5
pkgrel=5
pkgdesc="mandoc (formerly mdocml) UNIX manpage compiler toolset"
url="https://mandoc.bsd.lv/"
arch="all"
license="ISC and BSD-2-Clause and BSD-3-Clause"
makedepends="zlib-dev"
checkdepends="perl"
install="$pkgname.post-deinstall"
triggers="$pkgname-apropos.trigger=/usr/share/man/*"
replaces="mdocml"
provides="mdocml=$pkgver-r$pkgrel"
subpackages="$pkgname-apropos $pkgname-soelim"
source="https://mandoc.bsd.lv/snapshots/mandoc-$pkgver.tar.gz
shared-libmandoc.patch
outdated-warn-disable.patch
fix-tbl-null-pointer.patch
mandoc_configure.patch
simplify-compat.patch
"
prepare() {
default_prepare
cat >configure.local<<-__EOF__
PREFIX=/usr
MANDIR=/usr/share/man:/usr/local/share/man
LIBDIR=/usr/lib
CFLAGS="$CFLAGS"
UTF8_LOCALE="en_US.UTF-8"
MANPATH_DEFAULT="/usr/share/man:/usr/local/man:/usr/local/share/man"
MANPATH_BASE="/usr/share/man:/usr/local/share/man"
LN="ln -sf"
HAVE_LESS_T=0
__EOF__
}
build() {
./configure
make
}
check() {
LD_LIBRARY_PATH="$builddir" make regress
}
package() {
make -j1 DESTDIR="$pkgdir" base-install lib-install
}
apropos() {
pkgdesc="makewhatis/whatis and apropos tools and index"
mkdir -p "$subpkgdir"/usr/sbin "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/apropos \
"$pkgdir"/usr/bin/whatis \
"$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/sbin/makewhatis \
"$subpkgdir"/usr/sbin/
}
soelim() {
pkgdesc="so elimination tool"
depends=""
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/soelim \
"$subpkgdir"/usr/bin/
}
sha512sums="848f290847f3095757f25647e6d73eb7044018b145bf6f9dc8b5db164b1421911efdc5b3b9022ec3a2c5af9687a84d5acedee810f2bd2f7caaa9242dadb2cc52 mandoc-1.14.5.tar.gz
b1bd2c197584948cc8bab2310e759b8942b9f9479254ffb5a8223cfa6ba03c9e1a4d402c5440b8d9f962be9a020287d3dd8556592c17f2b46f15f405d9d373cb shared-libmandoc.patch
ced05e8b57fb9705c6d8d8570cd6b06ad187511a4c243ac2dbc34064aa164ca49e0c877160134161dcb98ebd5e61a5c23d5741f03ef95903ff56193dd07f36a1 outdated-warn-disable.patch
bb46bc3a0f07881e5362b32d478632fb209f9740017c467f2258e9b7ddbece6175bba598287d8c24626c9ee7217eb92ae60e0a30aeafdfc4b0154f4d312cbcca fix-tbl-null-pointer.patch
a44d86fb012acbc05eb233122e7ca3170e5e01c7c49115c2fe83f49891d442ba94601a039018cfa01cc1ef3cd02d5aff4d1e01abd4230b8bc2091e649ad991db mandoc_configure.patch
0979e8ee20d6163669f7ab3ace1f959ba9d831c208785c3522261c72ddc2f60ce8420ed36ea963c46a72b9ffdbcb9199da436b13e14c0ca4d938351d170adfa7 simplify-compat.patch"

View file

@ -0,0 +1,27 @@
===================================================================
RCS file: /cvs/mandoc/tbl_term.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -p -r1.69 -r1.70
--- a/tbl_term.c 2019/03/16 21:35:48 1.69
+++ b/tbl_term.c 2019/03/18 08:00:34 1.70
@@ -629,7 +629,8 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp
lw = cpp == NULL || cpn == NULL ||
(cpn->pos != TBL_CELL_DOWN &&
- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
+ (dpn == NULL || dpn->string == NULL ||
+ strcmp(dpn->string, "\\^") != 0))
? hw : 0;
tbl_direct_border(tp, BHORIZ * lw,
col->width + col->spacing / 2);
@@ -675,7 +676,8 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp
rw = cpp == NULL || cpn == NULL ||
(cpn->pos != TBL_CELL_DOWN &&
- (dpn == NULL || strcmp(dpn->string, "\\^") != 0))
+ (dpn == NULL || dpn->string == NULL ||
+ strcmp(dpn->string, "\\^") != 0))
? hw : 0;
/* The line crossing at the end of this column. */

View file

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/sbin/makewhatis -a -T utf8 /usr/share/man

View file

@ -0,0 +1,3 @@
#!/bin/sh
exec rm -f /usr/share/man/mandoc.db

View file

@ -0,0 +1,12 @@
diff -Naur a/configure b/configure
--- a/configure
+++ b/configure
@@ -41,7 +41,7 @@
OSNAME=
UTF8_LOCALE=
-CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -`
+CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i PATH="${PATH}" make -sf -`
CFLAGS=
LDADD=
LDFLAGS=

View file

@ -0,0 +1,12 @@
diff -Naur a/main.c b/main.c
--- a/main.c 2019-03-03 15:24:23.600767518 +0000
+++ b/main.c 2019-03-03 15:27:37.609820365 +0000
@@ -676,8 +676,6 @@
return globres != -1;
found:
- warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s",
- name, sec, BINM_MAKEWHATIS, paths->paths[ipath]);
if (res == NULL) {
free(file);
return 1;

View file

@ -0,0 +1,76 @@
diff --git a/Makefile b/Makefile
index f4e2954..d153224 100644
--- a/Makefile
+++ b/Makefile
@@ -367,9 +367,13 @@ WWW_INCS = eqn.h.html \
tbl_int.h.html \
tbl_parse.h.html
+LIBMANDOC = libmandoc.so
+MANDOCLIB = -L. -lmandoc
+
# === USER CONFIGURATION ===============================================
include Makefile.local
+CFLAGS += -fPIC
# === DEPENDENCY HANDLING ==============================================
@@ -392,7 +396,7 @@ distclean: clean
rm -f Makefile.local config.h config.h.old config.log config.log.old
clean:
- rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
+ rm -f $(LIBMANDOC) $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
rm -f mandoc $(MAIN_OBJS)
rm -f man.cgi $(CGI_OBJS)
rm -f mandocd catman catman.o $(MANDOCD_OBJS)
@@ -431,11 +435,11 @@ base-install: mandoc demandoc soelim
$(INSTALL_MAN) makewhatis.8 \
$(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
-lib-install: libmandoc.a
+lib-install: $(LIBMANDOC)
mkdir -p $(DESTDIR)$(LIBDIR)
mkdir -p $(DESTDIR)$(INCLUDEDIR)
mkdir -p $(DESTDIR)$(MANDIR)/man3
- $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
+ $(INSTALL_LIB) $(LIBMANDOC) $(DESTDIR)$(LIBDIR)
$(INSTALL_LIB) eqn.h man.h mandoc.h mandoc_aux.h mandoc_parse.h \
mdoc.h roff.h tbl.h $(DESTDIR)$(INCLUDEDIR)
$(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \
@@ -511,23 +515,23 @@ Makefile.local config.h: configure $(TESTSRCS)
@echo "$@ is out of date; please run ./configure"
@exit 1
-libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
- ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
+libmandoc.so: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
+ $(CC) $(LDFLAGS) -shared -o $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) $(LDADD)
-mandoc: $(MAIN_OBJS) libmandoc.a
- $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD)
+mandoc: $(MAIN_OBJS) $(LIBMANDOC)
+ $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) $(MANDOCLIB) $(LDADD)
man.cgi: $(CGI_OBJS) libmandoc.a
$(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
-mandocd: $(MANDOCD_OBJS) libmandoc.a
- $(CC) -o $@ $(LDFLAGS) $(MANDOCD_OBJS) libmandoc.a $(LDADD)
+mandocd: $(MANDOCD_OBJS) $(LIBMANDOC)
+ $(CC) -o $@ $(LDFLAGS) $(MANDOCD_OBJS) $(LIBMANDOC) $(LDADD)
-catman: catman.o libmandoc.a
- $(CC) -o $@ $(LDFLAGS) catman.o libmandoc.a $(LDADD)
+catman: catman.o $(LIBMANDOC)
+ $(CC) -o $@ $(LDFLAGS) catman.o $(LIBMANDOC) $(LDADD)
-demandoc: $(DEMANDOC_OBJS) libmandoc.a
- $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
+demandoc: $(DEMANDOC_OBJS) $(LIBMANDOC)
+ $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) $(LIBMANDOC) $(LDADD)
soelim: $(SOELIM_OBJS)
$(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS)

View file

@ -0,0 +1,275 @@
Upstream: Unknown, taken from Fedora
Reason: Fixes compilation with gcc-10
diff -up mandoc-1.14.5/compat_err.c.orig mandoc-1.14.5/compat_err.c
--- mandoc-1.14.5/compat_err.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_err.c 2020-02-06 14:30:56.839081393 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_ERR
-
-int dummy;
-
-#else
+#if HAVE_ERR == 0
/* $Id: compat_err.c,v 1.4 2015/11/26 07:42:11 schwarze Exp $ */
/*
diff -up mandoc-1.14.5/compat_fts.c.orig mandoc-1.14.5/compat_fts.c
--- mandoc-1.14.5/compat_fts.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_fts.c 2020-02-06 14:31:04.095057713 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_FTS
-
-int dummy;
-
-#else
+#if HAVE_FTS == 0
/* $Id: compat_fts.c,v 1.14 2017/02/18 12:24:24 schwarze Exp $ */
/* $OpenBSD: fts.c,v 1.56 2016/09/21 04:38:56 guenther Exp $ */
diff -up mandoc-1.14.5/compat_getline.c.orig mandoc-1.14.5/compat_getline.c
--- mandoc-1.14.5/compat_getline.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_getline.c 2020-02-06 14:31:14.287024456 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_GETLINE
-
-int dummy;
-
-#else
+#if HAVE_GETLINE == 0
/* $Id: compat_getline.c,v 1.1 2015/11/07 20:52:52 schwarze Exp $ */
/*
diff -up mandoc-1.14.5/compat_getsubopt.c.orig mandoc-1.14.5/compat_getsubopt.c
--- mandoc-1.14.5/compat_getsubopt.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_getsubopt.c 2020-02-06 14:31:24.446991303 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_GETSUBOPT
-
-int dummy;
-
-#else
+#if HAVE_GETSUBOPT == 0
/* $Id: compat_getsubopt.c,v 1.5 2014/08/17 20:53:50 schwarze Exp $ */
/* $OpenBSD: getsubopt.c,v 1.4 2005/08/08 08:05:36 espie Exp $ */
diff -up mandoc-1.14.5/compat_isblank.c.orig mandoc-1.14.5/compat_isblank.c
--- mandoc-1.14.5/compat_isblank.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_isblank.c 2020-02-06 14:31:33.686961149 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_ISBLANK
-
-int dummy;
-
-#else
+#if HAVE_ISBLANK == 0
/* $Id: compat_isblank.c,v 1.2 2015/10/06 18:32:19 schwarze Exp $ */
/*
diff -up mandoc-1.14.5/compat_mkdtemp.c.orig mandoc-1.14.5/compat_mkdtemp.c
--- mandoc-1.14.5/compat_mkdtemp.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_mkdtemp.c 2020-02-06 14:31:41.758934811 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_MKDTEMP
-
-int dummy;
-
-#else
+#if HAVE_MKDTEMP == 0
/* $Id: compat_mkdtemp.c,v 1.2 2015/10/06 18:32:19 schwarze Exp $ */
/*
diff -up mandoc-1.14.5/compat_ohash.c.orig mandoc-1.14.5/compat_ohash.c
--- mandoc-1.14.5/compat_ohash.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_ohash.c 2020-02-06 14:31:49.943908103 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_OHASH
-
-int dummy;
-
-#else
+#if HAVE_OHASH == 0
/* $OpenBSD: ohash.c,v 1.1 2014/06/02 18:52:03 deraadt Exp $ */
diff -up mandoc-1.14.5/compat_progname.c.orig mandoc-1.14.5/compat_progname.c
--- mandoc-1.14.5/compat_progname.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_progname.c 2020-02-06 14:31:57.278884167 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_PROGNAME
-
-int dummy;
-
-#else
+#if HAVE_PROGNAME == 0
/* $Id: compat_progname.c,v 1.1 2015/11/06 16:30:33 schwarze Exp $ */
/*
diff -up mandoc-1.14.5/compat_reallocarray.c.orig mandoc-1.14.5/compat_reallocarray.c
--- mandoc-1.14.5/compat_reallocarray.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_reallocarray.c 2020-02-06 14:32:05.686856733 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_REALLOCARRAY
-
-int dummy;
-
-#else
+#if HAVE_REALLOCARRAY == 0
/* $Id: compat_reallocarray.c,v 1.4 2014/12/11 09:05:01 schwarze Exp $ */
/* $OpenBSD: reallocarray.c,v 1.2 2014/12/08 03:45:00 bcook Exp $ */
diff -up mandoc-1.14.5/compat_recallocarray.c.orig mandoc-1.14.5/compat_recallocarray.c
--- mandoc-1.14.5/compat_recallocarray.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_recallocarray.c 2020-02-06 14:32:14.070829371 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_RECALLOCARRAY
-
-int dummy;
-
-#else
+#if HAVE_RECALLOCARRAY == 0
/* $Id: compat_recallocarray.c,v 1.1 2017/06/12 19:05:47 schwarze Exp $ */
/* $OpenBSD: malloc.c,v 1.225 2017/05/13 07:11:29 otto Exp $ */
diff -up mandoc-1.14.5/compat_strcasestr.c.orig mandoc-1.14.5/compat_strcasestr.c
--- mandoc-1.14.5/compat_strcasestr.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_strcasestr.c 2020-02-06 14:32:21.591804829 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_STRCASESTR
-
-int dummy;
-
-#else
+#if HAVE_STRCASESTR == 0
/* $Id: compat_strcasestr.c,v 1.4 2014/12/11 09:19:32 schwarze Exp $ */
/* $NetBSD: strcasestr.c,v 1.3 2005/11/29 03:12:00 christos Exp $ */
diff -up mandoc-1.14.5/compat_stringlist.c.orig mandoc-1.14.5/compat_stringlist.c
--- mandoc-1.14.5/compat_stringlist.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_stringlist.c 2020-02-06 14:29:49.568300904 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_STRINGLIST
-
-int dummy;
-
-#else
+#if HAVE_STRINGLIST == 0
/* $Id: compat_stringlist.c,v 1.6 2015/11/07 14:22:29 schwarze Exp $ */
/*
diff -up mandoc-1.14.5/compat_stringlist.h.orig mandoc-1.14.5/compat_stringlist.h
diff -up mandoc-1.14.5/compat_strlcat.c.orig mandoc-1.14.5/compat_strlcat.c
--- mandoc-1.14.5/compat_strlcat.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_strlcat.c 2020-02-06 14:32:36.471756272 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_STRLCAT
-
-int dummy;
-
-#else
+#if HAVE_STRLCAT == 0
/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
diff -up mandoc-1.14.5/compat_strlcpy.c.orig mandoc-1.14.5/compat_strlcpy.c
--- mandoc-1.14.5/compat_strlcpy.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_strlcpy.c 2020-02-06 14:32:44.447730243 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_STRLCPY
-
-int dummy;
-
-#else
+#if HAVE_STRLCPY == 0
/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
diff -up mandoc-1.14.5/compat_strndup.c.orig mandoc-1.14.5/compat_strndup.c
--- mandoc-1.14.5/compat_strndup.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_strndup.c 2020-02-06 14:32:52.264704732 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_STRNDUP
-
-int dummy;
-
-#else
+#if HAVE_STRNDUP == 0
/* $Id: compat_strndup.c,v 1.1 2018/02/27 11:16:23 schwarze Exp $ */
/* OpenBSD: strndup.c,v 1.2 2015/08/31 02:53:57 guenther Exp */
diff -up mandoc-1.14.5/compat_strsep.c.orig mandoc-1.14.5/compat_strsep.c
--- mandoc-1.14.5/compat_strsep.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_strsep.c 2020-02-06 14:33:01.807673592 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_STRSEP
-
-int dummy;
-
-#else
+#if HAVE_STRSEP == 0
/* $Id: compat_strsep.c,v 1.4 2014/12/11 09:05:01 schwarze Exp $ */
/* $OpenBSD: strsep.c,v 1.7 2014/02/05 20:42:32 stsp Exp $ */
diff -up mandoc-1.14.5/compat_strtonum.c.orig mandoc-1.14.5/compat_strtonum.c
--- mandoc-1.14.5/compat_strtonum.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_strtonum.c 2020-02-06 14:33:10.839644116 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_STRTONUM
-
-int dummy;
-
-#else
+#if HAVE_STRTONUM == 0
/* $Id: compat_strtonum.c,v 1.1 2015/02/16 14:56:22 schwarze Exp $ */
/* $OpenBSD: strtonum.c,v 1.7 2013/04/17 18:40:58 tedu Exp $ */
diff -up mandoc-1.14.5/compat_vasprintf.c.orig mandoc-1.14.5/compat_vasprintf.c
--- mandoc-1.14.5/compat_vasprintf.c.orig 2019-03-10 05:56:43.000000000 -0400
+++ mandoc-1.14.5/compat_vasprintf.c 2020-02-06 14:33:18.119620363 -0500
@@ -1,10 +1,6 @@
#include "config.h"
-#if HAVE_VASPRINTF
-
-int dummy;
-
-#else
+#if HAVE_VASPRINTF == 0
/* $Id: compat_vasprintf.c,v 1.3 2015/10/06 18:32:19 schwarze Exp $ */
/*
diff -up mandoc-1.14.5/tbl_html.c.orig mandoc-1.14.5/tbl_html.c