! 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 !
Unmaximize by dragging erratic


Description Adam Purkrt 2015-06-05 00:04:09 CEST
I use a config with just one panel at the bottom, and encountered the following bug:

1) Start e.g. Thunar, mousepad, terminal - whatever to have a regular, not maximized, yet maximizable window

2) Catch the window (vertically) with the mouse in the middle of its titlebar. Drag this window to the top edge of the screen - the window gets maximized. Don't release the button immediately.

3) While still holding the mouse button down (i.e. still dragging) move the cursor couple of pixels down from the very top edge. The window will still be in maximized state (this behaviour is welcomed and ok). Now release the button. You have a maximized window. So far so good.

4) Now move the mouse cursor to the very top of the screen, then press and hold LMB and (slowly) drag the mouse down. For the first 10pixels or so (for about half the titlebar height), the window would erratically, repeatedly, very quickly switch back and forth between unmaximized/maximized case (this is bug#1). After dragging downwards enough, the windows finally becomes unmaximized, but sometimes the mouse cursor is completely off (e.g. half screen to the right) of the window title bar, which severely limits the places where the (now unmaximized) window could be moved to (this is bug #2).

While this might seem contrived, it is not. I encountered the bug from time to time, when the drag to maximize/unmaximize would behave erratically. Took me some time to figure out what triggers it; the result is the above procedure.

I would like to kindly ask to fix this annoyance.

xfwm4 version 4.12.3 (revision 7fdcb53) on Arch linux
Comment 1 haarp 2016-06-18 09:03:54 CEST
Can confirm. Dragging down maximized windows this way does cause some flickering.
Comment 2 Adam Purkrt 2018-01-14 20:41:57 CET
The bug exhibit itself when there is no panel at the top, i.e. the titlebar is on the top.

If there is a panel on the top (as in the default config), I was not able to reproduce the bug.

I have a single panel at the bottom, so I encounter this frequently..
Comment 3 Adam Purkrt 2018-01-15 05:26:22 CET
Created attachment 7540 
Patch removing the erratic behaviour when unmaximizing with dragging

The attached patch basically makes the problem go away.
Comment 4 Olivier Fourdan editbugs 2018-01-15 15:20:20 CET
Well, the code that attachment 7540  removes is to allow for some pointer movement before triggering un-maximize, so I am not sure how that could help with the issue (which I cannot reproduce btw).

So, if you can prepare a well formed patch (using "git format-patch"), reindent the code as necessary, with a commit message which explains how this helps with the issue and attach all this to this bug, I would most likely push it (assuming I agree with the explanation as to why this helps).
Comment 5 Adam Purkrt 2018-01-15 22:28:40 CET
The bug is triggered near the top edge of the screen and near the start of drag of maximized window titlebar. There must be no panel on the top, otherwise the bug won't trigger.

With each motion event, the maximization is toggled, in an area roughly 30x10 pixels (the vertical 10 is the "dist" from clientMoveTile(), 30 horizontally comes from 2*15).

In the original code in clientMoveEventFilter() near the proposed patch: when you begin to drag (slowly) a maximized window from the absolute top, clientToggleMaximizedAtPoint() gets called in clientMoveTile() once per each motion event, until 15 pixels away from original position, which leads to the back and forth maximization/unmaximization. After removing the check for the 15 pixels distance, maximized (and/or tiled) window get first unmaximized (with clientToggleMaximized()), and then potentially maximized immediately again inside clientMoveTile(), if it is still near the edge/corner. Hence it either stays maximized (this occurs near the edges) or get unmaximized when away from top, bottom or sides.

I hope I got it right and also hope this explains the patch.

I will try to prepare the well formed patch asap.
Comment 6 Adam Purkrt 2018-01-15 23:41:55 CET
Created attachment 7541 
Comment 7 Adam Purkrt 2018-01-16 17:02:29 CET
Created attachment 7542 
VIdeo demonstrating the bug
Comment 8 Adam Purkrt 2018-01-18 20:21:46 CET
Created attachment 7543 
fix to erratic unmaximization by dragging

improved style, added link to bug
Comment 9 Adam Purkrt 2018-01-18 22:53:53 CET
Created attachment 7544 

link to bug reformatted to proper style
Comment 10 Git Bot editbugs 2018-01-19 19:16:00 CET
Adam Purkrt referenced this bugreport in commit 84b905b7854bc04b00b681588b8d9cbd7f29493e

Fix to erratic unmaximization by dragging


Bug #11960

Reported by:
Adam Purkrt
Reported on: 2015-06-05
Last modified on: 2018-01-19


Olivier Fourdan
CC List:
1 user




Additional information