Bug 472649 - kscreen-doctor hangs when called from a global shortcut
Summary: kscreen-doctor hangs when called from a global shortcut
Status: RESOLVED WORKSFORME
Alias: None
Product: KScreen
Classification: Plasma
Component: kscreen-doctor (show other bugs)
Version: 5.27.6
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-26 08:19 UTC by Stephane Travostino
Modified: 2025-01-10 17:36 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane Travostino 2023-07-26 08:19:59 UTC
SUMMARY

If I programmatically toggle on/off a monitor with kscreen-doctor from a global KDE shortcut, the process just hangs and the screen is never toggled. The same exact invocation on the command line succeeds.


STEPS TO REPRODUCE
1. Go in the settings, and create a keyboard shortcut to enable/disable your monitor. In my case, `kscreen-doctor output.DP-3.enable/disable`
2. Execute the shortcut
3. Notice that nothing happens and that the kscreen-doctor process hangs and needs to be killed
4. Execute the same command in a shell, and notice that it executes successfully

OBSERVED RESULT

Nothing happens and that the kscreen-doctor process hangs and needs to be killed. The exact same command run in the shell, or pinned on the Task Manager works as expected.

EXPECTED RESULT

kscreen-doctor command to run successfully without hanging.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 38 Kinoite / Wayland
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Comment 1 jasonlandbridge 2023-09-12 20:28:52 UTC
Same issue here, I can provide some logs but from what I can tell, it hangs the moment it needs to be enabled
Comment 2 wafixa5827 2023-10-21 21:24:35 UTC
I have a related (possibly same) problem on 5.27.8 (Arch).

When I run a command such as: kscreen-doctor output.DP-2.mode.2560x1440@165 output.DP-2.position.0,0

This is my output:

kscreen.doctor: Taddaaa! Found mode "1" "2560x1440@165"
kscreen.doctor: Output 1 set mode "2560x1440@165"
kscreen.doctor: Output position QPoint(0,0)
kscreen.doctor: Set output position QPoint(0,0)
kscreen.doctor: setop exec returned KScreen::Config( 
KScreen::Output(1, "DP-2", connected enabled priority 1, pos: QPoint(0,0), res: QSize(1920, 1080), modeId: "1", scale: 1.5, clone: no, rotation: KScreen::Output::None, followPreferredMode: false) 
KScreen::Output(2, "HDMI-A-1", connected disabled priority 0, pos: QPoint(1707,0), res: QSize(1920, 1080), modeId: "0", scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false) )
[a@aPC ~]$ Initializing  "/usr/lib/qt/plugins/plasma/kcms/systemsettings/kcm_fonts.so"


Please notice the last line. You can see my shell prompt followed by "Initializing ... kcm_fonts.so"
It hangs here unless I press ENTER.
Comment 3 Zamundaaa 2025-01-10 17:36:32 UTC
Can't reproduce in Plasma 6.2, the command is executed without a problem