Open Techognito opened 1 year ago
I had the same issue. I simply just swapped the hdmi cables on vga out and it solved.
the problem still exit, and I'm using type-c cable
Same problem. If you have fixed setup you can change the number in the script to 1 or whatever the display is. But I use it on laptop, so I need more flexible solution, because this disables virtual desktops on my built-in display even if there is no monitor connected
The problem is that KWin scripting API does not expose primary screen information. The best thing I could come up with is this patch to main.js
:
@@ -1,3 +1,5 @@
+var primaryScreen = 0;
+
function bind(window) {
window.previousScreen = window.screen;
window.screenChanged.connect(window, update);
@@ -12,7 +14,6 @@
return;
}
- var primaryScreen = 0;
var currentScreen = window.screen;
var previousScreen = window.previousScreen;
window.previousScreen = currentScreen;
@@ -32,6 +33,7 @@
}
function main() {
+ primaryScreen = workspace.activeScreen;
workspace.clientList().forEach(bind);
workspace.clientList().forEach(update);
workspace.clientAdded.connect(bindUpdate);
Now the script remembers the very first active screen it sees (which should be your primary screen).
NB: Remember to relogin into your Plasma Session after applying this patch and enabling the script, otherwise it'll use your currently active screen.
@bemyak thanks, this worked for me also
On wayland this script selects the leftmost monitor as primary, even if another monitor is set to primary in settings