diff options
author | ssfdust | 2024-01-22 21:04:39 +0800 |
---|---|---|
committer | ssfdust | 2024-01-22 21:06:25 +0800 |
commit | 0e13092dac14a0e50f05f0b70821c35a7113ca19 (patch) | |
tree | 629939bffdd76a8b1e347a90185111425c1280ad | |
parent | 36b3269b7d6b1a6378a7e53d963ecd1113708296 (diff) | |
download | aur-0e13092dac14a0e50f05f0b70821c35a7113ca19.tar.gz |
Better workaround for egl freeze
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0001-egl-set-a-zero-swap-interval-on-Wayland.patch | 29 | ||||
-rw-r--r-- | 01-fix-egl-popup-freeze.patch | 119 | ||||
-rw-r--r-- | PKGBUILD | 9 |
4 files changed, 38 insertions, 125 deletions
@@ -1,6 +1,6 @@ pkgbase = cairo-dock-core-wayland-git pkgdesc = Light eye-candy fully themable animated dock with wayland support - pkgver = 3.4.99.alpha1.20240114.cf35d658 + pkgver = 3.4.99.alpha1.20240121.10601241 pkgrel = 1 url = https://github.com/dkondor/cairo-dock-core arch = i686 @@ -23,8 +23,8 @@ pkgbase = cairo-dock-core-wayland-git conflicts = cairo-dock options = debug source = cairo-dock-core-wayland-git::git+https://github.com/dkondor/cairo-dock-core.git#branch=wayland_new - source = 01-fix-egl-popup-freeze.patch + source = 0001-egl-set-a-zero-swap-interval-on-Wayland.patch sha256sums = SKIP - sha256sums = dbe476513329cc08552a47dc15f80ef102dbc103b3bf6a01f5eb1f2b057b8b51 + sha256sums = 1af64c4dea950b6b8a696c767b924f585c3a085e35ee775723dee95d4b4cf208 pkgname = cairo-dock-core-wayland-git diff --git a/0001-egl-set-a-zero-swap-interval-on-Wayland.patch b/0001-egl-set-a-zero-swap-interval-on-Wayland.patch new file mode 100644 index 000000000000..73d34be3c9c1 --- /dev/null +++ b/0001-egl-set-a-zero-swap-interval-on-Wayland.patch @@ -0,0 +1,29 @@ +From a6739cf2b3880795a45f4b5c861d7d3c2376188e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kondor=20D=C3=A1niel?= <kondor.dani@gmail.com> +Date: Sat, 20 Jan 2024 00:16:11 +0100 +Subject: [PATCH] egl: set a zero swap interval on Wayland + +--- + src/implementations/cairo-dock-egl.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/implementations/cairo-dock-egl.c b/src/implementations/cairo-dock-egl.c +index 137faa26..0583cd17 100644 +--- a/src/implementations/cairo-dock-egl.c ++++ b/src/implementations/cairo-dock-egl.c +@@ -200,7 +200,11 @@ static void _init_surface (G_GNUC_UNUSED GtkWidget *pWidget, GldiContainer *pCon + // create an EGL surface for this window + EGLDisplay *dpy = s_eglDisplay; + if (s_eglX11) egl_init_surface_X11 (pContainer, dpy, s_eglConfig); +- if (s_eglWayland) egl_init_surface_wayland (pContainer, dpy, s_eglConfig); ++ if (s_eglWayland) { ++ egl_init_surface_wayland (pContainer, dpy, s_eglConfig); ++ _container_make_current (pContainer); ++ eglSwapInterval (dpy, 0); ++ } + } + + static void _destroy_surface (G_GNUC_UNUSED GtkWidget* pWidget, GldiContainer *pContainer) { +-- +2.43.0 + diff --git a/01-fix-egl-popup-freeze.patch b/01-fix-egl-popup-freeze.patch deleted file mode 100644 index a4034e0ca6c5..000000000000 --- a/01-fix-egl-popup-freeze.patch +++ /dev/null @@ -1,119 +0,0 @@ -diff --git a/src/implementations/cairo-dock-foreign-toplevel.c b/src/implementations/cairo-dock-foreign-toplevel.c -index f73f6368..9480a784 100644 ---- a/src/implementations/cairo-dock-foreign-toplevel.c -+++ b/src/implementations/cairo-dock-foreign-toplevel.c -@@ -53,6 +53,11 @@ static void _show (GldiWindowActor *actor) - GdkSeat *seat = gdk_display_get_default_seat (dsp); - struct wl_seat* wl_seat = gdk_wayland_seat_get_wl_seat (seat); - zwlr_foreign_toplevel_handle_v1_activate (wactor->handle, wl_seat); -+ // note: we do a roundtrip here, since if the active window changes, -+ // the compositor might be closing our popups (i.e. subdocks) and -+ // we should get the popup_done() event as soon as possible to avoid -+ // race conditions with rendering -+ gldi_wayland_display_roundtrip (); - } - static void _close (GldiWindowActor *actor) - { -diff --git a/src/implementations/cairo-dock-plasma-window-manager.c b/src/implementations/cairo-dock-plasma-window-manager.c -index 286f79a0..f58d0b47 100644 ---- a/src/implementations/cairo-dock-plasma-window-manager.c -+++ b/src/implementations/cairo-dock-plasma-window-manager.c -@@ -58,6 +58,12 @@ static void _show (GldiWindowActor *actor) - org_kde_plasma_window_set_state (wactor->handle, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE, - ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); -+ // note: we do a roundtrip here, since if the active window changes, -+ // the compositor might be closing our popups (i.e. subdocks) and -+ // we should get the popup_done() event as soon as possible to avoid -+ // race conditions with rendering -+ // (note: this actually does not happen on at least KWin 5.24) -+ gldi_wayland_display_roundtrip (); - } - static void _close (GldiWindowActor *actor) - { -diff --git a/src/implementations/cairo-dock-wayland-manager.c b/src/implementations/cairo-dock-wayland-manager.c -index 1d35c361..4ba477b6 100644 ---- a/src/implementations/cairo-dock-wayland-manager.c -+++ b/src/implementations/cairo-dock-wayland-manager.c -@@ -555,6 +555,10 @@ static void _adjust_aimed_point (const Icon* pIcon, int w, int h, - - static gboolean _is_wayland() { return TRUE; } - -+void gldi_wayland_display_roundtrip (void) { -+ if (s_pDisplay) wl_display_roundtrip (s_pDisplay); -+} -+ - static void init (void) - { - //\__________________ listen for Wayland events -diff --git a/src/implementations/cairo-dock-wayland-manager.h b/src/implementations/cairo-dock-wayland-manager.h -index a58411d4..910d4643 100644 ---- a/src/implementations/cairo-dock-wayland-manager.h -+++ b/src/implementations/cairo-dock-wayland-manager.h -@@ -37,6 +37,8 @@ G_BEGIN_DECLS - extern GldiManager myWaylandMgr; - #endif - -+#ifdef HAVE_WAYLAND -+ - typedef enum { - /// notification called when a new monitor was added, data : the GdkMonitor added - NOTIFICATION_WAYLAND_MONITOR_ADDED = NB_NOTIFICATIONS_OBJECT, -@@ -45,8 +47,6 @@ typedef enum { - NB_NOTIFICATIONS_WAYLAND_DESKTOP - } CairoWaylandDesktopNotifications; - --void gldi_register_wayland_manager (void); -- - /// Get the screen edge this dock should be anchored to - CairoDockPositionType gldi_wayland_get_edge_for_dock (const CairoDock *pDock); - -@@ -56,5 +56,11 @@ GdkMonitor *gldi_dock_wayland_get_monitor (CairoDock *pDock); - /// Get the list of monitors currently managed -- caller should not modify the GdkMonitor* pointers stored here - GdkMonitor *const *gldi_wayland_get_monitors (int *iNumMonitors); - -+void gldi_wayland_display_roundtrip (void); -+ -+#endif // HAVE_WAYLAND -+ -+void gldi_register_wayland_manager (void); -+ - G_END_DECLS - #endif -diff --git a/src/implementations/cairo-dock-wayland-wm.c b/src/implementations/cairo-dock-wayland-wm.c -index f6044378..6846b304 100644 ---- a/src/implementations/cairo-dock-wayland-wm.c -+++ b/src/implementations/cairo-dock-wayland-wm.c -@@ -156,6 +156,11 @@ void gldi_wayland_wm_closed (GldiWaylandWindowActor *wactor, gboolean notify) - void gldi_wayland_wm_activated (GldiWaylandWindowActor *wactor, gboolean notify) - { - s_pMaybeActiveWindow = (GldiWindowActor*)wactor; -+ // note: we do a roundtrip here, since if the active window changed, -+ // the compositor might be closing our popups (i.e. subdocks) and -+ // we should get the popup_done() event as soon as possible to avoid -+ // race conditions with rendering -+ gldi_wayland_display_roundtrip (); - if (notify) gldi_wayland_wm_done (wactor); - } - -@@ -341,7 +346,7 @@ void gldi_wayland_wm_done (GldiWaylandWindowActor *wactor) - if (_update_state (wactor, TRUE)) continue; - // update the needs-attention property - if (_update_attention(wactor, TRUE)) continue; -- -+ - if (actor == s_pMaybeActiveWindow) - { - s_pActiveWindow = actor; -diff --git a/src/implementations/cairo-dock-wayland-wm.h b/src/implementations/cairo-dock-wayland-wm.h -index 4072ceef..da359184 100644 ---- a/src/implementations/cairo-dock-wayland-wm.h -+++ b/src/implementations/cairo-dock-wayland-wm.h -@@ -25,6 +25,7 @@ - #include <wayland-client.h> - #include <stdint.h> - #include "cairo-dock-struct.h" -+#include "cairo-dock-wayland-manager.h" - - struct _GldiWaylandWindowActor { - GldiWindowActor actor; @@ -5,7 +5,7 @@ # Contributor: ssfdust <ssfdust@gmail.com> pkgname=cairo-dock-core-wayland-git -pkgver=3.4.99.alpha1.20240114.cf35d658 +pkgver=3.4.99.alpha1.20240121.10601241 pkgrel=1 pkgdesc='Light eye-candy fully themable animated dock with wayland support' arch=('i686' 'x86_64') @@ -19,10 +19,13 @@ optdepends=( provides=("${pkgname%-git}" "cairo-dock") conflicts=("${pkgname%-git}" "cairo-dock") options=(debug) -source=("${pkgname}::git+https://github.com/dkondor/cairo-dock-core.git#branch=wayland_new" "01-fix-egl-popup-freeze.patch") +source=( + "${pkgname}::git+https://github.com/dkondor/cairo-dock-core.git#branch=wayland_new" + "0001-egl-set-a-zero-swap-interval-on-Wayland.patch" +) sha256sums=( 'SKIP' - 'dbe476513329cc08552a47dc15f80ef102dbc103b3bf6a01f5eb1f2b057b8b51' + '1af64c4dea950b6b8a696c767b924f585c3a085e35ee775723dee95d4b4cf208' ) _builddir="build" |