STEPS TO REPRODUCE 1. open Energy Saving KCM 2. switch tabs repeatedly 3. OBSERVED RESULT Visual glitch. Please watch the attached screen recording and observe the bug when switching to "On battery" from "On low battery" . The video was recorded on X11 but the bug is more noticeable on Wayland. EXPECTED RESULT no visual glitch SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.90.0 KDE Frameworks Version: 5.246.0 Qt Version: 6.6.0 Graphics Platform: Wayland
Created attachment 164013 [details] screen recording
We can probably work around the underlying FormLayout / StackLayout issue by having only a single page with controls and making that page handle power profile changes correctly. If my intuition holds, this should not only eliminate flicker but also preserve the scroll position when switching tabs, so it's easier to compare fields for different power profiles.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/302
Git commit 2a97c14551b4db96a5d976667346c42c5785e365 by Jakob Petsovits. Committed on 05/01/2024 at 19:43. Pushed by jpetso into branch 'master'. kcmodule: Fix flicker when switching between profile tabs This commit is not tackling whatever root cause might be causing the flickering (likely related to delayed layouting in FormLayout). Instead, we resolve the flicker by reusing the same single form for all tabs. So we don't switch between different sets of controls, but we merely reassign values for the one remaining set of controls. On the implementation side, the main thing that's required is a new Connections object with onProfileSettingsChanged() handler, to call the same reset logic that some components already use for handling change signals of individual properties within profileSettings. Controls that never break property bindings do not need any changes. M +135 -62 kcmodule/profiles/ui/ProfileConfig.qml M +33 -39 kcmodule/profiles/ui/main.qml https://invent.kde.org/plasma/powerdevil/-/commit/2a97c14551b4db96a5d976667346c42c5785e365