This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to prevent windows from going over the desktop limits ?

Tags: None
(comma "," separated)
fdangelo
Registered Member
Posts
11
Karma
0
Hello everyone

I'm currently working on a profesional program, and I need to configure windows for they cannot go over the limit of the desktop (so they will always be visible, whatever move you apply to them). I use Kwin 3 and 4. I know this is not a very common feature, but this is crucial for this program. If someone know how to configure that, don't hesitate !

Thanks

Fabien
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
I do not really understand what you want to achieve. Could you please elaborate a little bit more?
sir_herrbatka
Registered Member
Posts
212
Karma
0
i think he meant preventing window border from crossing the screen edge (amiga like).
fdangelo
Registered Member
Posts
11
Karma
0
Yes, this is it, sir_herrbatka. Sorry if it was a bit confuse...
luebking
Karma
0
Intercept move events of the window(), test the geometry against QDesktopWidget::availableGeometry() and snap it back to that bounds.

If you're developing that application you presumingly want to have that work with all windowmanagers and then have the program do it.
Any customized solution (for KWin4: a script; for KWin3: not possible) won't cut it.

WMs usually prevent the user from moving windows completely out of sight, but not (all) configure requests and rarely partial crossing.

If you want to get near that behavior, but for all windows:
kwriteconfig --file kwinrc --group Windows --key BorderSnapZone 10000
kwriteconfig --file kwinrc --group Windows --key SnapOnlyWhenOverlapping true
qdbus org.kde.kwin /KWin reconfigure

WARNING:
-------------
a) this will more or less break quick tiling
b) BorderSnapZone is capped by the "kcmshell4 kwinoptions" config dialog. If you ever open it and save settings, the behavior changes back.
fdangelo
Registered Member
Posts
11
Karma
0
Thanks luebking ! That is what I was looking for. I have already thought to use border snapping, but I didn't know the existence of the option SnapOnlyWhenOverlapping


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar