Fix UI lag when switching virtual desktop
Some checks failed
Build RPMs / build (sonic-interface-libraries.spec) (push) Failing after 11s
Build RPMs / build (sonic-win.spec) (push) Failing after 9s
Build RPMs / build (sonic-workspace.spec) (push) Failing after 7s

Fixes the UI lag caused by the floating panel animation
This commit is contained in:
Anders da Silva Rytter Hansen 2026-07-02 11:04:31 -03:00
commit 9a7eaaae1c
4 changed files with 100 additions and 2 deletions

View file

@ -0,0 +1,39 @@
From: Anders da Silva Rytter Hansen <andersrh@users.noreply.github.com>
Date: Thu, 2 Jul 2026 10:47:00 -0300
Subject: [PATCH] desktoppackage: disable panel floating/opacity animations
Disable the floating and opacity transitions so the panel changes state instantly and stays fluid.
This fixes the UI lag, when switching virtual desktops.
References: https://bugs.kde.org/show_bug.cgi?id=484501 and https://github.com/orgs/Sonic-DE/discussions/20
---
desktoppackage/contents/views/Panel.qml | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/desktoppackage/contents/views/Panel.qml b/desktoppackage/contents/views/Panel.qml
--- a/desktoppackage/contents/views/Panel.qml
+++ b/desktoppackage/contents/views/Panel.qml
@@ -133,19 +133,15 @@
}
// Floatingness is a value in [0, 1] that's multiplied to the floating margin; 0: not floating, 1: floating, between 0 and 1: animation between the two states
- readonly property int floatingnessAnimationDuration: Kirigami.Units.longDuration
+ // Disable the panel geometry animation: animated resizes of the panel
+ // window cause synchronous compositor work that stalls the desktop during
+ // virtual-desktop switches.
+ readonly property int floatingnessAnimationDuration: 0
property double floatingnessTarget: 0.0 // The animation is handled in panelview.cpp for efficiency
property double floatingness: 0.0
// PanelOpacity is a value in [0, 1] that's used as the opacity of the opaque elements over the transparent ones; values between 0 and 1 are used for animations
property double panelOpacity
- Behavior on panelOpacity {
- NumberAnimation {
- duration: Kirigami.Units.longDuration
- easing.type: Easing.OutCubic
- }
- }
-
KSvg.FrameSvgItem {
id: translucentItem
visible: root.floatingness === 0 && root.panelOpacity !== 1

View file

@ -11,7 +11,7 @@
Name: sonic-desktop-interface
Summary: Plasma Desktop shell
Version: 6.6.4
Release: 11%{?dist}
Release: 12%{?dist}
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 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)
#URL: https://invent.kde.org/plasma/%{name}
@ -35,6 +35,11 @@ Source20: breeze-fedora-0.3.tar.gz
# Do not remove this as it breaks Fedora's QA policy
Patch101: hide-virtual-keyboard-indicator-on-sddm.patch
# Disable panel floating/opacity animations. Animated panel resizes cause
# synchronous compositor work that stalls the desktop when switching virtual
# desktops, so make the panel state changes instant instead.
Patch102: sonic-desktop-interface-6.6.4-x11-panel-lag.patch
## upstreamable patches
BuildRequires: pkgconfig(libusb)
@ -393,6 +398,10 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/kaccess.desktop
%changelog
* Thu Jul 02 2026 Anders da Silva Rytter Hansen <andersrh@users.noreply.github.com> - 6.6.4-12
- Disable panel floating/opacity animations to avoid stutter when the panel
changes state (e.g. switching virtual desktops).
* Fri Apr 10 2026 Steve Cossette <farchord@gmail.com> - 6.6.4-1
- 6.6.4