Bug 482698 - kscreen-doctor disables screen instead of enabling it
Summary: kscreen-doctor disables screen instead of enabling it
Status: REPORTED
Alias: None
Product: KScreen
Classification: Plasma
Component: kscreen-doctor (show other bugs)
Version: 5.27.11
Platform: Kubuntu Linux
: NOR major
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-07 12:04 UTC by Yann Salmon
Modified: 2024-09-22 16:32 UTC (History)
0 users

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


Attachments
Situation where DP-0 is working as single screen (21.21 KB, text/x-log)
2024-03-07 12:04 UTC, Yann Salmon
Details
Situation where both screens should be working but DP-0 is off (21.21 KB, text/x-log)
2024-03-07 12:05 UTC, Yann Salmon
Details
Situation after setting dual config with the GUI (works properly) (21.35 KB, text/x-log)
2024-03-07 12:06 UTC, Yann Salmon
Details
Comparing two ways of interacting with kscreen-doctor (16.17 KB, text/plain)
2024-09-22 16:32 UTC, Yann Salmon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Salmon 2024-03-07 12:04:58 UTC
Created attachment 166575 [details]
Situation where DP-0 is working as single screen

SUMMARY

When invoking kscreen-doctor to enable a secondary screen, the primary screen gets disabled.


STEPS TO REPRODUCE
1. Write a script kscreen-switch with the following content :

if [[ "$(xrandr --listactivemonitors | grep -c DVI-D-0)" == "0" ]]; then
  kscreen-doctor output.DVI-D-0.enable output.DVI-D-0.position.-1920,0
else
  kscreen-doctor output.DVI-D-0.disable
fi

2. Invoke the script.
3. Invoke the script again.

OBSERVED RESULT
On first invocation, DVI-D-0 goes live and DP-0 goes blank.

On second invocation, DVI-D-0 does blank.

EXPECTED RESULT
On first invocation, DP-0 should not go blank.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-97-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Xeon® CPU E3-1245 v5 @ 3.50GHz
Memory: 15.5 Gio of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2

ADDITIONAL INFORMATION

Explicitly adding output.DP-0.enable to each line of the script makes DP-0 go live in second invocation, but does not prevent it from going blank in the first.

On first invocation with that addition, the console shows

Enabling output 444
kscreen.doctor: Output position QPoint(-1920,0)
kscreen.doctor: Set output position QPoint(-1920,0)
Enabling output 455
kscreen.doctor: setop exec returned KScreen::Config( 
KScreen::Output(444, "DVI-D-0", connected enabled, pos: QPoint(0,0), res: QSize(-1, -1), modeId: "", scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false) 
KScreen::Output(455, "DP-0", connected enabled primary, pos: QPoint(1920,0), res: QSize(3840, 2160), modeId: "456", scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false) )


Which is not consistent with the fact that DP-0 goes blank.

However, the log produced by kscreen-console bug show that something pertaining to DP-0 is disabled.

Setting up the dual screen configuration with the GUI from Plasma works properly.
Comment 1 Yann Salmon 2024-03-07 12:05:50 UTC
Created attachment 166576 [details]
Situation where both screens should be working but DP-0 is off
Comment 2 Yann Salmon 2024-03-07 12:06:22 UTC
Created attachment 166577 [details]
Situation after setting dual config with the GUI (works properly)
Comment 3 Yann Salmon 2024-03-07 12:53:56 UTC
Still happens after upgrade to 

Operating System: Kubuntu 22.04
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-97-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Xeon® CPU E3-1245 v5 @ 3.50GHz
Memory: 15.5 Gio of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2
Comment 4 Yann Salmon 2024-03-07 13:44:07 UTC
I seem to be able to have a functioning setup by splitting the command into two :

if [[ "$(xrandr --listactivemonitors | grep -c DVI-D-0)" == "0" ]]; then
  kscreen-doctor output.DVI-D-0.enable
  kscreen-doctor output.DVI-D-0.position.-1920,0
else
  kscreen-doctor output.DVI-D-0.disable
fi


But that seems contrary to the intended goal of kscreen-doctor.
Comment 5 Yann Salmon 2024-09-22 16:32:16 UTC
Update that this is still happening after an upgrade to
Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-45-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Xeon® CPU E3-1245 v5 @ 3.50GHz
Memory: 31.2 Gio of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2
Manufacturer: Dell Inc.
Product Name: Precision Tower 3620

Fundamentally, doing kscreen-doctor A B does not yield the same result as kscreen-doctor A ; kscreen-doctor B.
Comment 6 Yann Salmon 2024-09-22 16:32:55 UTC
Created attachment 173967 [details]
Comparing two ways of interacting with kscreen-doctor