Steady Screen

Kwin Scripts

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
6.0

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 ;-)

Ratings & Comments

9 Comments

dagaz

8 8 great It really helps a great deal when the screens turn on after suspending (DPMS)

koko2k

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.

thomas12777

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)

koko2k

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

thomas12777

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)

koko2k

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

thomas12777

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)

koko2k

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" }

koko2k

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

Pling
0 Affiliates
Details
license
version 1.0
updated
added
downloads 24h 1
mediaviews 24h 0
pageviews 24h 1

More Kwin Scripts from thomas12777:

GameMode
thomas12777
last update date: 10 years ago

Score 6.1

Spam Transients
thomas12777
last update date: 10 years ago

Score 5.0

Big Screen
thomas12777
last update date: 11 years ago

Score 6.1

Screen Snapping
thomas12777
last update date: 11 years ago

Score 5.7

Debug Clients
thomas12777
last update date: 11 years ago

Score 5.0

Unminimize windows w/o taskbar entry
thomas12777
last update date: 11 years ago

Score 5.0

Other Kwin Scripts:

MiniStack
faho
last update date: 11 years ago

Score 5.0

TIL3R
causa-prima
last update date: 11 years ago

Score 5.7

True Video Wall
zezinho
last update date: 10 years ago

Score 5.0

eQui-binds
enno
last update date: 9 years ago

Score 5.0

Demands Attention Only on Current Deskto
mgraesslin
last update date: 12 years ago

Score 5.8

Opacity Menu
mgraesslin
last update date: 12 years ago

Score 6.1



System Tags