Bug 488963

Summary: wl_output order doesn't respect KScreen priority settings
Product: [Plasma] kwin Reporter: Oleg <dreamkepeer>
Component: multi-screenAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version First Reported In: 6.1.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screen Priorities
kscreen-console outputs log

Description Oleg 2024-06-22 10:33:22 UTC
Created attachment 170806 [details]
Screen Priorities

SUMMARY
I have 3 monitors, with my primary monitor in the middle. I've set screen priorities with the middle monitor as a primary monitor. But KWin doesn't respect this setting and place wl_outputs in arbitrary order (probably how monitors were initialized during boot). This is very annoying since a there's no concept of primary monitor in Wayland and most fullscreen apps (mostly SDL ones) are putting themselves on a first reported wl_output.

STEPS TO REPRODUCE
1. Log into system (either with autologin or SDDM)
2. Look at the KScreen priority settings (attachment)
3. Compare them to wl_outputs order in System Info Wayland section (additional info)

OBSERVED RESULT
wl_outputs order MUST match KScreen's display order (kscreen-console outputs or kscreen-doctor -o)

EXPECTED RESULT
wl_outputs order differs from KScreen's one, most importantly primary display isn't the first reported wl_output

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 15.6 ГиБ of RAM
Graphics Processor: AMD Radeon RX 6700 XT

ADDITIONAL INFORMATION
interface: 'kde_output_device_v2',                       version:  8, name: 59
interface: 'kde_output_device_v2',                       version:  8, name: 60
interface: 'kde_output_device_v2',                       version:  8, name: 61
interface: 'wl_output',                                  version:  4, name: 62
	name: HDMI-A-1
	description: Philips Consumer Electronics Company Philips 235PL/DL41103143133
	x: 3840, y: 0, scale: 1,
	physical_width: 510 mm, physical_height: 287 mm,
	make: 'Philips Consumer Electronics Company', model: 'Philips 235PL/DL41103143133',
	subpixel_orientation: unknown, output_transform: 90°,
	mode:
		width: 1920 px, height: 1080 px, refresh: 60.000 Hz,
		flags: current
interface: 'wl_output',                                  version:  4, name: 63
	name: DP-2
	description: Philips Consumer Electronics Company Philips 226V4/UK81443014262
	x: 0, y: 0, scale: 1,
	physical_width: 477 mm, physical_height: 268 mm,
	make: 'Philips Consumer Electronics Company', model: 'Philips 226V4/UK81443014262',
	subpixel_orientation: unknown, output_transform: normal,
	mode:
		width: 1920 px, height: 1080 px, refresh: 60.000 Hz,
		flags: current
interface: 'wl_output',                                  version:  4, name: 64
	name: DP-1
	description: ASR PG27FF1A/0x00000D42
	x: 1920, y: 0, scale: 1,
	physical_width: 598 mm, physical_height: 336 mm,
	make: 'ASR', model: 'PG27FF1A/0x00000D42',
	subpixel_orientation: unknown, output_transform: normal,
	mode:
		width: 1920 px, height: 1080 px, refresh: 165.003 Hz,
		flags: current
Comment 1 Oleg 2024-06-22 10:34:55 UTC
Created attachment 170807 [details]
kscreen-console outputs log

Here is also "kscreen-console outputs" log.
Comment 2 Oleg 2024-06-22 10:38:02 UTC
I've mixed up expected and observed results sections, sorry.
Comment 3 Vlad Zahorodnii 2024-06-24 08:28:35 UTC
> wl_outputs order MUST match KScreen's display order

No, they must not. wl_output can be in any order. There's a separate protocol to communicate the output order, but the apps should not it, it's for plasma's internal use.