Bug 478271 - Flicker when switching tabs in Energy Saving KCM
Summary: Flicker when switching tabs in Energy Saving KCM
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_powerdevil (show other bugs)
Version: 5.90.0
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-08 16:51 UTC by Patrick Silva
Modified: 2024-01-05 18:48 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screen recording (1.20 MB, video/webm)
2023-12-08 16:51 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2023-12-08 16:51:12 UTC
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
Comment 1 Patrick Silva 2023-12-08 16:51:45 UTC
Created attachment 164013 [details]
screen recording
Comment 2 Jakob Petsovits 2023-12-16 06:28:15 UTC
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.
Comment 3 Bug Janitor Service 2023-12-29 01:05:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/302
Comment 4 Jakob Petsovits 2024-01-05 18:48:03 UTC
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