summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorssfdust2024-01-18 13:41:45 +0800
committerssfdust2024-01-18 13:41:45 +0800
commit36b3269b7d6b1a6378a7e53d963ecd1113708296 (patch)
treeb6247bb75797a8d66bf1fe98f86346b488d06df7
parentbc1abf2a23f19b74c1cb66a9af0f86a7821ff623 (diff)
downloadaur-36b3269b7d6b1a6378a7e53d963ecd1113708296.tar.gz
Add patch for fixing egl popup freezing issue
-rw-r--r--.SRCINFO4
-rw-r--r--01-cairo-dock-dock-facility.patch13
-rw-r--r--01-fix-egl-popup-freeze.patch119
-rw-r--r--PKGBUILD7
4 files changed, 126 insertions, 17 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d3fd7fc7b51e..641ca4ab5a11 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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-cairo-dock-dock-facility.patch
+ source = 01-fix-egl-popup-freeze.patch
sha256sums = SKIP
- sha256sums = 9685d038d97e0b5edf882ef675504b6088b4495859c79bb80967dfbb743394ab
+ sha256sums = dbe476513329cc08552a47dc15f80ef102dbc103b3bf6a01f5eb1f2b057b8b51
pkgname = cairo-dock-core-wayland-git
diff --git a/01-cairo-dock-dock-facility.patch b/01-cairo-dock-dock-facility.patch
deleted file mode 100644
index d8d61935ad8e..000000000000
--- a/01-cairo-dock-dock-facility.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/gldit/cairo-dock-dock-facility.c b/src/gldit/cairo-dock-dock-facility.c
-index 3bd896be..7d3fd6ed 100644
---- a/src/gldit/cairo-dock-dock-facility.c
-+++ b/src/gldit/cairo-dock-dock-facility.c
-@@ -737,7 +737,7 @@ Icon * cairo_dock_calculate_wave_with_position_linear (GList *pIconList, int x_a
- }
-
- ic = pointed_ic;
-- while (ic != pIconList)
-+ while (ic->prev && ic != pIconList)
- {
- icon = ic->data;
-
diff --git a/01-fix-egl-popup-freeze.patch b/01-fix-egl-popup-freeze.patch
new file mode 100644
index 000000000000..a4034e0ca6c5
--- /dev/null
+++ b/01-fix-egl-popup-freeze.patch
@@ -0,0 +1,119 @@
+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;
diff --git a/PKGBUILD b/PKGBUILD
index d2badfa1b2b2..d7f008a40b3b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,8 +19,11 @@ 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-cairo-dock-dock-facility.patch")
-sha256sums=('SKIP' '9685d038d97e0b5edf882ef675504b6088b4495859c79bb80967dfbb743394ab')
+source=("${pkgname}::git+https://github.com/dkondor/cairo-dock-core.git#branch=wayland_new" "01-fix-egl-popup-freeze.patch")
+sha256sums=(
+ 'SKIP'
+ 'dbe476513329cc08552a47dc15f80ef102dbc103b3bf6a01f5eb1f2b057b8b51'
+)
_builddir="build"