! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Multi-monitor: Cannot resize window properly due to snapping
Status:
RESOLVED: FIXED

Comments

Description Alois Mahdal 2014-06-09 13:25:11 CEST
I have multi-monitor setup with one monitor in landscape orientation, other one in "portrait", as on left part of this diagram:

              +-------+                  +-------+
              |       |                  |       |
              |       |                  |   3   |
              |       |                  |       |
    +---------|   B   |        +---------| . . . |
    |         |       |        |         |       |
    |    A    |       |        |    1    |   2   |
    |         |       |        |         |       |
    +---------+-------+        +---------+-------+

Now windows placed in area 1 or 2 can be resized normally.  But if a window is placed in area 3, once I try to resize it vertically in such manner that bottom border would be affected, the bottom border immediately will always immediately snap to imaginary line between 2 and 3.

The snapping happens always, no matter how close the border actually is, so it's impossible to resize the window normally.  (It's still possible to work around this by resizing it using top corners/border and moving it, or by moving it elsewhere, resizing and moving back).

With above layout, I haven't seen the problem affecting top, left or right borders, as one could expect.  Also it does not affect window that is partially in area 2 and partially 3.
Comment 1 Alois Mahdal 2014-06-09 13:25:50 CEST
Created attachment 5521 
resizing Orage window - before
Comment 2 Alois Mahdal 2014-06-09 13:26:15 CEST
Created attachment 5522 
resizing Orage window - after
Comment 3 Alois Mahdal 2014-06-09 13:28:35 CEST
Created attachment 5523 
layout
Comment 4 Alois Mahdal 2014-06-09 13:29:12 CEST
Created attachment 5524 
displays.xml
Comment 5 Alois Mahdal 2014-06-09 13:32:44 CEST
Note to screenshots:

The presence of the Mousepad window on screens is only to demonstrate where exactly the bordwe is landing (i.e. it's not exactly at level of top of the monitor A, or at level where A's panel ends).  It does not affect the behavior; if the Mousepad window is removed, the Orage window would snap to the same place.
Comment 6 Alois Mahdal 2014-06-09 13:40:14 CEST
Also, the system where I see the problem is Fedora 20:

xfwm4-4.10.1-2.fc20.x86_64
Comment 7 Kamil Kaminski 2014-07-08 16:29:27 CEST
I can confirm and I'm experiencing same bug on xfwm4 4.10.1.
Comment 8 Kamil Kaminski 2014-09-26 05:10:36 CEST
I posted a $50 bounty for this: https://www.bountysource.com/issues/3235334-multi-monitor-cannot-resize-window-properly-due-to-snapping, fix this bug and receive $50.

I use dual screen setup as seen below:

              +-------------+
              |  resize ok  |
              |             |
              |-     B     -|
              |             |
              |    snaps    |
+-------------+-------------+
| xfce panel  |
|             |
|     A       |
|             |
|  xfce dock  |
+-------------+

Screen B is where I experience this bug, resizing windows in the bottom half of B by using bottom border of a window always snaps windows to the bottom of B.

I use xfce daily on a wiped work macbook (not a big fan of apple).
Comment 9 Simon P 2014-10-11 20:16:50 CEST
My monitor layout is like this (note the vertical overlap):
+----------+
|          |
|          |
|    B     |
|          |-------------+
|          |  xfce panel |
+----------|             |
           |      A      |
           |             |
           |             |
           +-------------+

I get this snapping while resizing windows on B, but only if I have a panel at the top of A AND it is set to reserve space on the borders. The effect disappears if I move the panel to the bottom of A or if I check "don't reserve space".

When the snapping occurs, it is to the line through the lower edge of the panel. The bug seems to be in the way space is reserved for the panel (also desktop icons are squeezed into the gap between this line and bottom of B).

(debian/testing + xfce from git master)
Comment 10 Simon P 2015-01-03 11:48:09 CET
Created attachment 5844 
patch to fix wrong snapping on window resize

Attached is a patch which fixes this bug for me.

The bug lies in the way the resized window is checked for valid position: the current code doesn't support partial struts. It turns out that the function for performing this check on moving a window can also be used here, so the patch is very simple. Using the same code for both checks ought to make maintenance easier in the future.

The diff is against the latest release version 4.11.2, but has been tested with the latest code from git.

One note on the patched version: on resizing a window in such a way that part of it lies in a zone forbidden by struts, the window will be moved so that it is in a legitimate part of the screen. At first, this behaviour seems strange and I spent a long time trying to work out how to stop this. But eventually I concluded this is correct, on the principle that, unless impossible or dangerous, direct user requests should be accommodated. (Example, in the layout in my previous comment, dragging the bottom-right corner of a window on the left monitor onto the right monitor can put that window's top-right corner into the space above the panel on the right monitor. In this case the entire window is moved below the level of the panel.)
Comment 11 Olivier Fourdan editbugs 2015-01-04 17:50:15 CET
contrainPos can't be used in this context, it moves the window but does not change the size.
Comment 12 Olivier Fourdan editbugs 2015-01-05 22:18:05 CET
Actually, we can use constrainPos(), just need to record the position before and compare to the position after and resize accordingly.

Should be fixed with commit b97b148, thanks for the idea.

Bug #10951

Reported by:
Alois Mahdal
Reported on: 2014-06-09
Last modified on: 2015-01-05

People

Assignee:
Olivier Fourdan
CC List:
2 users

Version

Version:
4.10.1

Attachments

resizing Orage window - before (737.19 KB, image/png)
2014-06-09 13:25 CEST , Alois Mahdal
no flags
resizing Orage window - after (692.19 KB, image/png)
2014-06-09 13:26 CEST , Alois Mahdal
no flags
layout (24.24 KB, image/png)
2014-06-09 13:28 CEST , Alois Mahdal
no flags
displays.xml (1.33 KB, application/xml)
2014-06-09 13:29 CEST , Alois Mahdal
no flags
patch to fix wrong snapping on window resize (2.24 KB, patch)
2015-01-03 11:48 CET , Simon P
no flags

Additional information