Bug 483948 - Repeatedly pressing shortcut for power profiles OSD stacks windows
Summary: Repeatedly pressing shortcut for power profiles OSD stacks windows
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 6.0.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Fabian Arndt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 00:07 UTC by Nicolas Fella
Modified: 2024-05-30 22:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2024-03-19 00:07:05 UTC
STEPS TO REPRODUCE
1. Press Meta+B shortcut to activate power profiles OSD many times

OBSERVED RESULT
Each time a OSD window gets created. This isn't super visible since they are all on top of each other, but it's noticeable because the shadow gets thicker

EXPECTED RESULT
If the OSD is already open no second window is openend

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0
Qt Version: 6.7
Comment 1 Nate Graham 2024-04-12 01:55:01 UTC
Hah oops! Does not look like it affects the KScreen OSD, just the Powerdevil OSD.
Comment 2 Fabian Arndt 2024-05-23 01:23:26 UTC
This also adds threads and reserves RAM, according to btop.
If you keep the shortcut pressed, the RAM is consumed very quickly.
Per iteration ~8MB and 8 threads.

The timer in osdmanager.c doesn't work (it does in KScreen) and the OSD doesn't close / the program doesn't quit.

PS: The program consumes ~170MB with just one window, is that normal for such a small QT thing?
Comment 3 Bug Janitor Service 2024-05-23 13:06:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/364
Comment 4 Nate Graham 2024-05-23 15:06:36 UTC
Git commit e22a99c2b8c177cea5a52b7aeb564ebe60a5079a by Nate Graham, on behalf of Fabian Arndt.
Committed on 23/05/2024 at 15:06.
Pushed by ngraham into branch 'master'.

Show power profiles OSD only once / fix mem leak

- Currently the OSD window can be spawned multiple times
- If you hold the shortcut, you can currently consume all your RAM
FIXED-IN: 6.1

M  +9    -3    osd/osdmanager.cpp
M  +1    -0    osd/osdmanager.h

https://invent.kde.org/plasma/powerdevil/-/commit/e22a99c2b8c177cea5a52b7aeb564ebe60a5079a