Bug 392784 - Triggering "Window Move" when LeftButton is held down doesn't move window
Summary: Triggering "Window Move" when LeftButton is held down doesn't move window
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-06 00:33 UTC by Chris Holland
Modified: 2018-04-06 04:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Holland 2018-04-06 00:33:01 UTC
Ran into this bug(?) while trying to recreate the Unity drag to unmaximize feature. I was originally trying to use libtaskmanager's "requestMove" function, but I've since tested with the global shortcut and it also doesn't work.

You can quickly test with:

sleep 5; qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "Window Move"

First run the command, then hold the LeftButton down until the shortcut is activated.

You'll notice the mouse moved to the center of the window, but the window will not follow the mouse. Nor will LeftClicks do anything anywhere on the screen. The mouse can still be moved around, but mouse clicks do nothing. If you release the mouse the window quickly moves to where you released it. Mouse clicks are still not responsive until you press Space (accept move) or Esc (cancel move).



I broke down the function calls here:

* https://github.com/kotelnik/plasma-applet-active-window-control/issues/30#issuecomment-364255622

The taskmanager widget calls `performMouseCommand(Options::MouseMove, ...)`

* https://github.com/KDE/kwin/blob/2e868c50df0aab40e4814724ee090ded6bd9072e/events.cpp#L1168
* https://github.com/KDE/kwin/blob/master/abstract_client.cpp#L998

while it seems the global shortcut calls `performMouseCommand(Options::MouseUnrestrictedMove, ...)`

* https://github.com/KDE/kwin/blob/d3aa33b51bd635008b519f565bdf0492e1531090/kwinbindings.cpp#L67
* https://github.com/KDE/kwin/blob/a0c91c6e19fec54054d1d6684d7c7a8ec0f1688c/useractions.cpp#L1710
* https://github.com/KDE/kwin/blob/a0c91c6e19fec54054d1d6684d7c7a8ec0f1688c/useractions.cpp#L1095

AbractClient uses almost the same logic for both though

* https://github.com/KDE/kwin/blob/master/abstract_client.cpp#L998
Comment 1 Martin Flöser 2018-04-06 04:27:23 UTC
Window move only works if KWin can grab the X mouse. By pressing the mouse before activating the window most likely holds a grab. Thus KWin cannot grab. This is an application bug: don't grab!