Bug 371573 - Move resize window on empty area only works every second time
Summary: Move resize window on empty area only works every second time
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D3154
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-24 12:31 UTC by Kai Uwe Broulik
Modified: 2016-10-31 10:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.8.3
mgraesslin: Wayland+
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2016-10-24 12:31:13 UTC
When dragging an empty area of a window only works every second time.

It seems it gets confused over some mouse button state which isn't reset when exiting move resize mode by releasing the mouse.

Reproducible: Always

Steps to Reproduce:
1. Run systemsettings5 on Wayland
2. Start dragging an empty area of the window, the window starts moving
3. Release mouse
4. Start dragging an empty area of the window again, nothing happens
5. Release mouse
6. Start dragging an empty area of the window again, works as in Step 2



When dragging an empty area and then pressing Escape at which point the move resize operation is canceled and the window snaps back, the next drag works just fine. It's just when releasing the mouse like normal then it gets confused.

Running in kwin_wayland this happens both with systemsettings5 -platform wayland and systemsettings5 -platform xcb so might not be specific to the wayland platform but the move resize thing in general.
Comment 1 Martin Flöser 2016-10-24 13:47:04 UTC
I guess the release of the button is never sent to the application as KWin grabs it.
Comment 2 Martin Flöser 2016-10-24 13:55:11 UTC
I'm able to reproduce also with weston-terminal. The input offset position does not get updated correctly when the window gets moved. Moving the pointer out of the window and back in again makes every move trigger the window.
Comment 3 Martin Flöser 2016-10-25 06:08:27 UTC
Possible patch at https://phabricator.kde.org/D3154

From my testing it works fine except for the following situation:
1. trigger move
2. don't move mouse
3. try to trigger again

weston-terminal has no problem with this situation so that might be a problem on the client side of the stack.
Comment 4 Martin Flöser 2016-10-31 10:51:35 UTC
Git commit 82054a406a6470c763d72c39f6c7fdf5667ee629 by Martin Gräßlin.
Committed on 31/10/2016 at 10:51.
Pushed by graesslin into branch 'Plasma/5.8'.

Send a pointer leave when triggering a move resize

Summary:
When triggering a move resize all following pointer events are grabbed
by KWin itself. Thus the correct behavior is to informe the client about
it and send a pointer leave.

This ensures that after the move resize ended the pointer gets a new
enter. By sending anew pointer enter the position gets updated to the
new position which so far did not happen and the client generated events
on the wrong position.
FIXED-IN: 5.8.3

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3154

M  +69   -1    autotests/integration/move_resize_window_test.cpp
M  +15   -0    pointer_input.cpp
M  +1    -0    pointer_input.h

http://commits.kde.org/kwin/82054a406a6470c763d72c39f6c7fdf5667ee629