Steady Screen
Kwin Scripts
Score 52%
Description:

Keeps windows attached to screen when the screen number (primary screen) or count (top/left adition) changes.

ONLY TESTED ON DUAL SCREEN!

Doesn\'t mean it will implode your 3rd and 4th screen, but i\'ve no idea whether it will work as expected.


--
The preview is certainly a copyright violation, but i couldn\'t resist and just hope that Matt won\'t sue kde-look ... or me ;-)

koko2k

4 years ago

Just tried, but didn't succeeded.
Maybe i didn't understood well what this script does.
Not only the panel from the left screen went and stayed on the right one.
I've had a kwrite window on the left screen, but after turning the screen "off" and "on" again, the kwrite window went to the right screen as well and stayed there as well.

Without the script, after re-enabling the left screen, all of the windows (but the panels) went to the left screen.

Report

C

thomas12777

3 years ago

This is pretty mcuh what the script does and "it's complicated"

tl; dr:
with the script, windows are supposed to stay on the primary or secondary screen.

See bug #286146

KWin does only ensure the windows remain visible but it doesn't stick them to a screen.
So if you add a screen on the left, windows from the other screen would "move" there (actually they they where they are in global coordinates, but the 0,0 corner moved from the right screen to the left) and there's request to stop that and keep the windows on the right screen.

That's however not all. The dominant screen layout thinks of "primary" and "secondary" rather than "left" and "right", so if you remove the primary screen, the secondary will become the primary and all windows moved there. If you then re-add the primary screen, the seconary screen becomes the secondary screen and the windows would (by the script) move from the former primary screen (the actual secondary one) to the new (and actual) primary screen.

Eg. just changing the primary screen would swap windows.

What you describe (remove,re-add) is kinda special case and not handled.
The KWin core will maintain the former geometry of windows that have "not been touched" (ie. moved or resized by the user)
This was added mostly to deal with window resizes due to screen resolution changes (gameplay case)

Report

koko2k

4 years ago

I've a panel on the left screen (call it 1), and one on the right (call it 2).
Whan i disable the left screen, 1 goes to the right screen, when i enable the left screen again, 1 stays on the rightmost screen.
Panels are windows.
Is there a way to manage them?
Thanks

Report

C

thomas12777

4 years ago

if (clients[i].specialWindow || clients[i].noBorder) {
// ignore docks etc. as well as undecorated but keep tool- and utility windows

I explicitly skipped them since stuff like desktop, docks or yakuake usually fixes themselve on screen changes (in a "better" way than a generic handling could be)

I guess i could add a whitelist matching the window class (what's the output of "xprop WM_CLASS" on the panel - plasma panels should follow the desktop)

Report

koko2k

4 years ago

I'll try to change the code by myself, thanks for pointing out.
However, what i was trying to do was a workaround for a long standing bug:
https://bugs.kde.org/show_bug.cgi?id=293453

Report

C

thomas12777

3 years ago

Hehe - i had absolute panel lengths in be::shell for ~10 minutes before figuring that it would be a stupid idea.

That bug could partially be worked around by a kwin script but is absolutely not subject to this one (which doesn't change window sizes to begin with)

However, it would be much better to fix the bug (to avoid nasty heuristics; the script would have to guess the orientation of the panel, as you want to adjust the length, but not the thickness)

Report

koko2k

4 years ago

xprop report this:

WM_STATE(WM_STATE):
WM_WINDOW_ROLE(STRING) = "panel_2"
WM_CLIENT_LEADER(WINDOW): window id # 0x1c00009
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NAME(STRING) = "plasma-desktop"
WM_LOCALE_NAME(STRING) = "it_IT.UTF-8"
WM_CLASS(STRING) = "Plasma", "Plasma"
WM_HINTS(WM_HINTS):
WM_NORMAL_HINTS(WM_SIZE_HINTS):
WM_CLIENT_MACHINE(STRING) = "Gozer"
WM_COMMAND(STRING) = { "/usr/bin/plasma-desktop" }

Report

koko2k

4 years ago

I've a panel on the left screen (call it 1), and one on the right (call it 2).
Whan i disable the right screen, 1 goes to the right screen, when i enable the right panel again, 1 stays on the right screen.
Panels are is a windows. Is there a way to manage them?
Thanks

Report

product-maker mirkogennari Oct 07 2015

product-maker 6 6

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
1.0
updated Dec 14 2013
added Dec 14 2013
downloads today
0
page views today 0