Reply to topic

Confusion around screen enumeration in QML/JS scripting

SnowyCoder
Registered Member
Posts
1
Karma
0
Hello, I'm new to both this forum and KDE-related development, please forgive my mistakes.
I was playing around with the Desktop Shell Scripting Consle (the interactive console used for testing PlasmaShell scripts).
I noticed that the enumeration of the desktops and screens isn't very intuitive, first of all running
Code: Select all
print(desktops().length)
Printed the number "3", that is quite unusual since I have only two monitors.
Then I wanted to see what screen was associated with what desktop and I saw that the enumeration was the following:
Code: Select all
d = desktops()
for (var i = 0; i < d.length; i++) {
    print (i + "->" + d[i].screen);
}

result:
Code: Select all
0->-1
1->0
2->2

Why do I have a "-1" monitor? And why don't I have a "1" monitor but it jumps right to the "2" screen?
I think that this part is quite under-documented as only few lines talk about the "desktops" function and I only found the"screen" property trough js reflection.
I plan to automate the screen enumeration trough a script, can anyone more expert than me explain this behaviour?
Thanks in advance.
Rossi Lorenzo.

Environment: Manjaro + KDE
Monitors: 2

Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], grahm, jmacleod, Majestic-12 [Bot], nrykhe, paleo, rblackwell, Sogou [Bot], YaCy [Bot]