Bug 228815

Summary: Window jumps around when unmaximized using screen edge gesture activated by holding mouse on titlebar
Product: [Plasma] kwin Reporter: Nikola Kovacs <nx.devnull>
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: benderamp, maxijac, myk002
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nikola Kovacs 2010-02-27 23:18:28 UTC
Version:            (using KDE 4.4.0)
Installed from:    Ubuntu Packages

Steps to reproduce:

1. Activate "Maximize windows by dragging to top edge" in screen edges.
2. Maximize a window.
3. Press and hold the mouse button on the titlebar of the maximized window. Do not move the mouse!

What happens:

The window will unmaximize and enter move mode (it will become semitransparent), but it will jump to its previous unmaximized position (the position wasn't updated because you didn't move the mouse). If you then move the mouse a bit, it will jump back to where the mouse is.

What should happen:

The window should unmaximize and enter move mode, but it should be under the mouse cursor, not its previous unmaximized position.

On a side note: Can you make it so that the window is not unmaximized until the user actually moves it? Google Chrome doesn't have the button press timeout and enters move mode immediately, which means that clicking its titlebar will always unmaximize it if the gesture is enabled.
Comment 1 Nikola Kovacs 2010-02-27 23:57:27 UTC
I've also reported bug 228819 because of the Chrome issue.
Comment 2 Martin Flöser 2010-02-28 10:22:20 UTC
*** Bug 228819 has been marked as a duplicate of this bug. ***
Comment 3 Martin Flöser 2010-02-28 10:41:40 UTC

*** This bug has been marked as a duplicate of bug 222100 ***
Comment 4 Nikola Kovacs 2010-02-28 10:51:46 UTC
This isn't a duplicate of bug 222100, bug 228819 is.
Comment 5 Martin Flöser 2010-03-14 10:45:49 UTC
We should move the window on unmaximizing
Comment 6 Martin Flöser 2010-04-03 13:12:40 UTC
*** Bug 233164 has been marked as a duplicate of this bug. ***
Comment 7 Martin Flöser 2010-04-22 19:44:17 UTC
*** Bug 235091 has been marked as a duplicate of this bug. ***
Comment 8 Thomas Lübking 2011-02-23 16:56:58 UTC
*** Bug 244719 has been marked as a duplicate of this bug. ***
Comment 9 anton 2011-07-29 14:42:27 UTC
4.7.0, the issue is still here as described in this duplicate https://bugs.kde.org/show_bug.cgi?id=233164 :

1. Start new application (Dolphin)
2. Maximize it
3. Press mouse on the middle of window decoration and drag it down

result:
Window would be demiximized as expected, but mouse pointer would hold the
window by the left edge of the decoration.

expected result:
mouse pointer should hold the window by its middle.
Comment 10 Bruno J. 2011-07-29 15:12:31 UTC
Yes it still occurs in KDE SC 4.7

It definnitely should not be handled this way. Probably like calculating the % relative to the entire bar where the pointer is and calculating the new window position to have the mouse at the same relative % as before.

Like for example, if I have my mouse at 250px from a maximized window top left corner, when I drag it, if it was 1000px wide : position = 25% from top left so if it is reduced to say a 100px wide window, my new pointer should end up at 25px (25% from the new 100px length) from the left corner.

What do you think ?

I don't know how this is managed on others window managers.
Comment 11 anton 2011-07-29 15:21:19 UTC
>Probably like calculating the % relative to the entire bar...

actually it already works in this way - the issue only happens when the window is 1st demaximized in this way after starting - if you reproduce the issue with one just started window, then maximize and demaximize same window with mouse again, it would work as expected.
Comment 12 Thomas Lübking 2012-03-19 18:37:55 UTC
http://git.reviewboard.kde.org/r/104347/
Comment 13 Thomas Lübking 2012-03-21 22:11:26 UTC
Git commit 3e011abbdaad63abb3396f86f39f210007dace15 by Thomas Lübking.
Committed on 19/03/2012 at 19:23.
Pushed by luebking into branch 'master'.

fake a move event when dropping out of quick tiling
REVIEW: 104347

M  +4    -0    kwin/geometry.cpp

http://commits.kde.org/kde-workspace/3e011abbdaad63abb3396f86f39f210007dace15