Revert previous workaround and fix it in a more correct way in Sonic-Win and Sonic-Workspace by not updating by every single frame but instead update per 50ms
Some checks failed
Build RPMs / build (sonic-interface-libraries.spec) (push) Failing after 11s
Build RPMs / build (sonic-win.spec) (push) Failing after 6s
Build RPMs / build (sonic-workspace.spec) (push) Failing after 7s

This commit is contained in:
Anders da Silva Rytter Hansen 2026-07-02 14:43:28 -03:00
commit cf0089e100
7 changed files with 173 additions and 93 deletions

View file

@ -0,0 +1,42 @@
From: Anders da Silva Rytter Hansen <andersrh@users.noreply.github.com>
Date: Thu, 02 Jul 2026 12:00:00 +0000
Subject: [PATCH] Batch strut-triggered workspace rearranges to reduce stutter
When a panel animates between floating and docked states it can change
its strut several times in quick succession. KWin handled those by
calling Workspace::rearrange() immediately, which recalculates work areas
and calls checkWorkspacePosition() on every client. That O(n) work on
every strut update causes visible stutter on X11 when other animations
are running.
Use the existing scheduleRearrange() path instead and bump its timer
from 0 ms to 50 ms so rapid strut changes are coalesced into a single
re-layout. This keeps the work area correct while reducing the amount
of synchronous work done during panel transitions.
---
src/events.cpp | 2 +-
src/workspace.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/src/events.cpp 2026-04-08 10:00:41.000000000 -0300
+++ b/src/events.cpp 2026-07-02 12:20:39.184413094 -0300
@@ -398,7 +398,7 @@
}
if ((dirtyProperties & NET::WMStrut) != 0
|| (dirtyProperties2 & NET::WM2ExtendedStrut) != 0) {
- workspace()->rearrange();
+ workspace()->scheduleRearrange();
}
if ((dirtyProperties & NET::WMIcon) != 0) {
getIcons();
--- a/src/workspace.cpp 2026-04-08 10:00:41.000000000 -0300
+++ b/src/workspace.cpp 2026-07-02 12:20:49.966586529 -0300
@@ -2178,7 +2178,7 @@
void Workspace::scheduleRearrange()
{
- m_rearrangeTimer.start(0);
+ m_rearrangeTimer.start(50);
}
void Workspace::rearrange()

View file

@ -4,7 +4,7 @@
Name: sonic-win
Version: 6.6.4
Release: 11%{?dist}
Release: 12%{?dist}
Summary: KDE Window manager
License: BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only) AND MIT
@ -18,6 +18,7 @@ URL: https://github.com/Sonic-DE/%{name}
Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
## upstream patches
Patch0: sonic-win-6.6.4-strut-throttle.patch
## proposed patches
@ -297,6 +298,10 @@ mkdir -p %{buildroot}%{_sysconfdir}/xdg/Xwayland-session.d
%changelog
* Thu Jul 02 2026 Anders da Silva Rytter Hansen <andersrh@users.noreply.github.com> - 6.6.4-12
- Batch strut-triggered workspace rearranges to reduce stutter during panel
state transitions.
* Sun Apr 12 2026 Steve Cossette <farchord@gmail.com> - 6.6.4-2
- Added evdev as BR for controller support (#22)