Screen Snapping

Kwin Scripts

Source (required if based on other people's work):

1
Score 52%
Description:

NOTICE:
-------------
installation via GHNS won\'t get you the config dialog.
Instead download the file and install it by

plasmapkg -i screenSnapping.kwinscript -t kwinscript

---
This overrides stock screen snapping and snaps to the decoration directly (unlike snap-to-deco which fixes the position after the actual snap and stopping the movement)

In addition, vertical, horizontal, inner and outer snap distance can be configured independently.

giogziro95

1 year ago

A couple of problems:

1. Snapping to the bottom edge while resizing doesn't work.
2. Snapping to the left edge while resizing doesn't work when part of the window is above or bellow the screen real estate.
3. Same as 2, but for the right edge.

Report

woko1754

2 years ago

Thanks from me too. It's still working, even on Plasma 5 !!

I never will understand why they changed the behavior.

Report

C

thomas12777

2 years ago

"They"? Actually I wrote the relevant patch.

We changed the behavior on top of the agreement that the screen edges are valuable (fitt's law) and the deco borders make little use of that value (the only thing you can do with them is to remove the window from that valuable area...) but "steal" them from the decorated client UI (scrollbars, toolbuttons, ...)

That caused a stupid situation for bad luck conditions. Few weeks after the patch, kde-workspace was "frozen" (shifting focus towards KDE 5) and some more weeks later, first reports of unhappy users filed in.

While one would probably not have gone for such rather invasive change, knowing it was "set in stone" (we'd just have added it to KDE5 instead), we neither could act anymore. Calamities *shrug*

We'll likely ultimately either pipe snapping through a script, so one can eg. treat konsole different from kwrite and the left corner different from the right etc. or provide a setting and rules.

Report

jstalnak

4 years ago

This is the solution I was looking for. You might want to add to the description that users need to go to their System Settings > Window Behavior > KWin Scripts to enable it.

Report

davesp

4 years ago

Thank you for this!

The KDE devs may have forgotten that they can set side borders to zero width if they so highly value their screen real estate. Then they could have spared us this aggravation.

This is the first time I had to install a KWinScript to fix an issue (which shouldn't have been introduced in the first place).

Well done!

Report

spacecase-25

4 years ago

Works well on screen edges, but doesn't work at all (no snapping enabled) at joining screen edges when using more than one monitor (normally Kwin would snap windows on these edges). Can this be added? Thanks.

Report

spacecase-25

4 years ago

Actually there is snapping with this script enabled, but there's overhang between the two screens.

Report

C

thomas12777

4 years ago

It's supposed to work since the matching is done to

var area = workspace.clientArea(KWin.WorkArea, workspace.activeScreen, workspace.currentDesktop);

and the algorithm doesn't make differences between inner and outer screen edged.

It also works as expected here.
Can you please post the output of "xrandr -q"?

Report

spacecase-25

4 years ago

ben@arch-desktop:~$ xrandr -q
Screen 0: minimum 320 x 200, current 3840 x 1200, maximum 16384 x 16384
DFP1 disconnected (normal left inverted right x axis y axis)
DFP2 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 495mm x 310mm
1920x1200 59.95*+
1920x1080 59.95
1600x1200 59.95
1680x1050 59.95
1400x1050 59.95
1280x1024 59.95
1440x900 59.95
1280x960 59.95
1280x800 59.95
1280x768 59.95
1280x720 59.95
1024x768 59.95
800x600 59.95
640x480 59.95
DFP3 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 444mm x 249mm
1920x1080 59.80*+ 59.94 60.00 59.94
1776x1000 59.94 59.94
1680x1050 59.94 59.80
1400x1050 59.94 59.80
1600x900 59.94
1280x1024 59.94 59.80
1440x900 59.94
1280x960 60.00
1360x768 60.02
1280x768 60.00
1280x720 60.00 59.94
1024x768 60.00
1152x648 59.94
800x600 60.32
720x480 60.00 59.94
640x480 59.94
CRT1 disconnected (normal left inverted right x axis y axis)

Report

C

thomas12777

4 years ago

Hmm - simple horizontal strip. Looks like mine.

Do you have window snapping enabled and/or could there be windows or panels (latter don't require window snapping) that couls impact the behavior?

Report

spacecase-25

4 years ago

Center snapping was actually disabled (oops). However, with it enabled, this is infact an issue. This is also an issue when windows are opened in the "center" of my screen, so despite my original complaint being invalid, there's still a bug here.

Thanks for all your time working this through with me.

Report

C

thomas12777

4 years ago

Let's see whether we can sort that out ;-)

Center snapping was disabled but window snapping enabled?
And as result windows would snap to other windows and by this bleed into the other screen?

Was/is the window snapping distance bigger than the screen snapping distance?

(Maybe you could upload a screenshot of the problematic setting and constellation, ie. windows "mis-snapped"?)

Report

spacecase-25

4 years ago

I'm not sure what you're asking, but here's a screenshot. Look closely at the circled regions. You can clearly see overlap onto the second screen. All other snapping works just fine.

http://i.imgur.com/9nR9ZoZ.jpg

Report

C

thomas12777

4 years ago

Thanks a lot - that looks like an "off-by-one" issue, but doesn't occur here.

Do you get the same for the oxygen decoration?

If not:
what decoration do you use (some aurorae theme I assume) and does it also happen when suspending the compositor (Shift+Alt+F12)?

Report

product-maker mirkogennari Oct 07 2015

product-maker 6 6

File (click to download) Version Description Packagetype Architecture Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
1.0
updated Feb 06 2014
added Feb 06 2014
downloads today
0
page views today 6
System Tags linux unix