Bug 271926

Summary: click + drag on non title bar area does not work after fist click + drag
Product: [Plasma] Oxygen Reporter: Mark Richardson <mail.markrichardson>
Component: styleAssignee: Hugo Pereira Da Costa <hugo.pereira.da.costa>
Status: RESOLVED FIXED    
Severity: minor CC: hugo.pereira.da.costa
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:

Description Mark Richardson 2011-04-28 17:01:55 UTC
Version:           0.0.1 (using KDE 4.6.2) 
OS:                Linux

Clicking and dragging a window by a non titlebar area a second time does not work until the mouse is moved.

Reproducible: Always




OS: Linux (x86_64) release 2.6.38-8-generic
Compiler: cc
Comment 1 Hugo Pereira Da Costa 2011-04-29 20:25:08 UTC
confirmed. Will investigate.
Comment 2 Hugo Pereira Da Costa 2011-04-29 20:39:46 UTC
ok. After double checking, I remember this issue. This is because the drag (sending mouse move events recieved by Qt to X11 to actually move the window) somehow messes-up Qt's internal event loop, concerning mouse click and mouse release (I think its because Qt gets the mouse click that triggers the drag, but never gets the mouse release, which is eaten by X11). This notably disable a second grab.

We have a hack to "reset the mess". basically, quickly/programatically moving the pointer outside of the window and back in. Now, this re-arm is triggered by mouse move (which Qt still handles well despite the mess). Hence the bug you report. 

I'll see if I can find a different way to trigger this re-arm the correct behavior, but to be honest I have little hope.

(the method that does all the dirtyness above is in kde-workspace/kstyles/oxygen/oxygenwindowmanager.cxx - WindowManager::AppEventFilter::appMouseEvent).
Comment 3 Hugo Pereira Da Costa 2011-04-30 12:22:38 UTC
Git commit b357e84a200595df2c2e6a420995e495a5887a69 by Hugo Pereira Da Costa.
Committed on 29/04/2011 at 20:58.
Pushed by hpereiradacosta into branch 'master'.

do not eat mouse-move + button press events caught by the window manager at end of grab.

CCBUG: 271926

M  +1    -1    kstyles/oxygen/oxygenwindowmanager.cpp     

http://commits.kde.org/kde-workspace/b357e84a200595df2c2e6a420995e495a5887a69
Comment 4 Hugo Pereira Da Costa 2011-04-30 12:24:07 UTC
ok. At least here, it fixes it (please double check), and was easier than I thought. Now I'm afraid of possible regressions.
Will use the patch for a couple of days an backport to 4.6 if nothing shows up.

Will keep the bug open in the meanwhile.

Thanks for reporting !
Comment 5 Hugo Pereira Da Costa 2011-05-10 22:59:18 UTC
Git commit 71cddd554bcd9127919ab358f6a73484ddeed458 by Hugo Pereira Da Costa.
Committed on 29/04/2011 at 20:58.
Pushed by hpereiradacosta into branch 'KDE/4.6'.

do not eat mouse-move + button press events caught by the window manager at end of grab.

CCBUG: 271926

M  +1    -1    kstyles/oxygen/oxygenwindowmanager.cpp     

http://commits.kde.org/kde-workspace/71cddd554bcd9127919ab358f6a73484ddeed458
Comment 6 Hugo Pereira Da Costa 2011-05-10 23:00:16 UTC
Since I could not detect any regression, I backported the fix to 4.6 branch.
closing.