In kwinscript I used to identify primary screen by simply `workspace.screens[0]`. Some other open source code (e.g. https://github.com/nclarius/KWin-window-positioning-scripts/blob/fe9d1641982912075f9debe68cc6b9afde7292d5/always-open-on-primary-screen/contents/code/main.js#L24-L25 ) does the same. After changing to wayland recently I found that `workspace.screens[0]` is no longer the primary screen that's set in "Display Configuration". It seems there is no reliable way in kwinscript to identify which screen is primary. SOFTWARE/OS VERSIONS Linux/KDE Plasma: archlinux; wayland KDE Plasma Version: 6.2.3 KDE Frameworks Version:6.8.0 Qt Version: 6.8.0
looks like https://invent.kde.org/plasma/kwin/-/merge_requests/6918/diffs?commit_id=418899080e07d6481cb0807f3a066b5c67713126 may fix it
Git commit 58cee934c46f49d31f0a1706c808d014a34ea5a5 by Vlad Zahorodnii. Committed on 20/12/2024 at 13:22. Pushed by vladz into branch 'master'. scripting: Expose output order M +6 -0 src/scripting/workspace_wrapper.cpp M +7 -0 src/scripting/workspace_wrapper.h https://invent.kde.org/plasma/kwin/-/commit/58cee934c46f49d31f0a1706c808d014a34ea5a5