fvwm3 icon indicating copy to clipboard operation
fvwm3 copied to clipboard

Snapping to screen edges doesn't work

Open gromnitsky opened this issue 2 years ago • 7 comments

In the current master (e327cc6) snapping to screen edges doesn't work any more (snapping to other windows still works).

Tested with a minimal ~/.fvwm/config:

Style * SnapAttraction 20 Windows Screen

In 42df1c8 everything snaps as expected.

gromnitsky avatar Jan 14 '22 19:01 gromnitsky

@gromnitsky -- please retest using latest code changes, but this is all working fine for me now.

Feel free to reopen if not.

ThomasAdam avatar Aug 26 '22 23:08 ThomasAdam

unfortunately, it still doesn't work for me

in the current master (cee5f75) snapping works in window-to-window case, but not in window-to-screen

screencast 42df1c8 vs. master:

https://www.youtube.com/watch?v=3OFfddnA7D4

gromnitsky avatar Aug 27 '22 05:08 gromnitsky

I have tested this, and it appears to be an issue with the parsing of the options.

Style * SnapAttraction 15 Windows ScreenAll

That works as expected, but using Screen or ScreenWindows doesn't. So it appears that the snapping capability is there, but the parser isn't correctly configuring it in any situation except ScreenAll.

somiaj avatar Aug 27 '22 15:08 somiaj

Interesting. Does the following help at all?

diff --git a/fvwm/move_resize.c b/fvwm/move_resize.c
index 87fc162ec..af384fad1 100644
--- a/fvwm/move_resize.c
+++ b/fvwm/move_resize.c
@@ -2426,7 +2426,8 @@ static void DoSnapAttract(FvwmWindow *fw, size_rect sz, position *p)
 
        int icon_mask = IS_ICONIFIED(fw) ? SNAP_SCREEN_ICONS :
                SNAP_SCREEN_WINDOWS;
-       bool snap_mon = (fw->snap_attraction.mode & SNAP_SCREEN_ALL ||
+       bool snap_mon = (fw->snap_attraction.mode &
+                       (SNAP_SCREEN | SNAP_SCREEN_ALL) ||
                fw->snap_attraction.mode & (SNAP_SCREEN & icon_mask)) ?
                true : false;
        bool snap_win = (fw->snap_attraction.mode &

ThomasAdam avatar Aug 27 '22 17:08 ThomasAdam

@ThomasAdam that gets closer to fixing it for me. Now the Style command given in this issue works, Style * SnapAttraction 15 Windows Screen, but Style * SnapAttraction 15 Windows ScreenWindows doesn't work. Might need to add SNAP_SCREEN_WINDOWS to that as well.

somiaj avatar Aug 27 '22 21:08 somiaj

Please try the ta/fix-652 branch. I think that's got most of this fixed now. Feedback appreciated.

ThomasAdam avatar Aug 27 '22 21:08 ThomasAdam

the ta/fix-652 branch works for me. thanks!

gromnitsky avatar Aug 28 '22 05:08 gromnitsky

Interesting, with fvwm3, the SnapAttraction has becomes unusable for me with a beamer connected and having a different resolution than the main screen. Windows are getting snapped in the smallest of the two screens, even though the bigger is defined as primary. Edit: Found a fix by decreasing EdgeResistance

dirteat avatar Dec 07 '22 19:12 dirteat

The difference between fvwm3 and fvwm2 is that snap attraction can now correctly snap to the monitor edges and not just the edges of all the monitors combined together. To me this is a big improvement because it allows snapping on the shared edge between monitors and on monitor edges if monitors are not the same size.

If you don't like snapping to the screen edges, configure the SnapAttraction style for the windows you want to disable this for appropriately. This bug report is about the fact that the configuration didn't match the manual page (it didn't deal with all the cases properly).

If your fix is EdgeResistance this is something different, as that is for scrolling between pages, not snapping to edges of screens.

somiaj avatar Dec 07 '22 19:12 somiaj

Yes, I kind of understood it is a new feature, even though the concept of "improvement" is quite subjective (I kind of get that it is better with adjacent screens, but, in my case, with screen within screen it needs tuning).

Anyway, EdgeResistance is fixing the resistance to the edges of the screen right now (tested with version 1.0.5). That is good for me, but might be a bug then.

dirteat avatar Dec 10 '22 15:12 dirteat