Summary: | Custom title bar widget of QDockWidget can't be moved / floated by mouse in Oxygen/QtCurve (KStyle bug?) | ||
---|---|---|---|
Product: | [Plasma] Oxygen | Reporter: | Filipe Azevedo <pasnox> |
Component: | style | Assignee: | Hugo Pereira Da Costa <hugo.pereira.da.costa> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hugo.pereira.da.costa |
Priority: | NOR | ||
Version: | 4.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Test case for the bug report |
Description
Filipe Azevedo
2011-03-25 19:37:03 UTC
Forgot to say only Oxygen/QtCurve are affected, all official Qt Styles and alternate style installed on the system works as expected. First: this is the right place. There is obviously a conflict a conflict between our window grabbing code, and whatever your custom thing does. It can be either: 1. our window dragging code not working proplerly 2. your custom code not handling events the way it should. Could you provide a stripped down compilable piece of code that allow us to reproduce the issue ? (your "steps to reproduce" can't really help here). This way we could sort it out between 1. or 2. PS: QtCurve shares the same window dragging code as oxygen. Interestingly you could also try bespin which has a similar (but differently coded) feature. Uou might need to turn on the feature in bespin config though. Thanks Christoph, will give a shot at one example from the code above to see where the problem is. Still having the real-case implementation from sNox would help :) (in principle, if the QMouseEvent::ignore() is called and do pass events to the dockwidget, then it should not interfere with our window grabbing (since it does not for non-custom dock widgets). But that's what I need to check, I guess ... More notes: just tried the /usr/lib/qt4/demos/mainwindow example, for which setTitleBarWidget is used on one of the dock widgets. It works just fine with oxygen, in terms of window grabbing. So this is not a *generic* bug. It has to be related to sNox own custom widget. (hence my original request) Created attachment 58341 [details]
Test case for the bug report
Here is the test case. I took the class as is from my lib and just comment / rework a little the code so it compil fine.
I still can reproduce the bug with oxygen/qtcurve, but not all others ( even bespin having the allow windows move option ).
Hope it can help ;)
Add tested the mainwindow demos and yes it works fine - it use QWidget. I repalced my custom widget by a frame / label / widget and it works. And set back QToolBar, no longer works :D ah yes. QToolBar. Thats why. We grab explicitly from QToolBar; not from the mainwindow below. I assume this is why it is not working. I'll work on a fix. Thanks for posting your code ! (cant even remember why I had to force grabbing manually from a toolbar. Will have a look). Thanks you ;) Git commit 5daddbefdecc0945becfe0aabdc29da514fda315 by Hugo Pereira Da Costa. Committed on 27/03/2011 at 12:22. Pushed by hpereiradacosta into branch 'master'. Make sure widget is not a Dock "title Widget" (passed via QDockWidget::setTitleBarWidget) before setting as dragable. CCBUG: 269410 M +22 -4 kstyles/oxygen/oxygenwindowmanager.cpp M +3 -0 kstyles/oxygen/oxygenwindowmanager.h http://commits.kde.org/kde-workspace/5daddbefdecc0945becfe0aabdc29da514fda315 Git commit 9ee656c206677d2ccf3dcca0079eff9bd3d91ec3 by Hugo Pereira Da Costa. Committed on 27/03/2011 at 12:22. Pushed by hpereiradacosta into branch 'KDE/4.6'. Make sure widget is not a Dock "title Widget" (passed via QDockWidget::setTitleBarWidget) before setting as dragable. CCBUG: 269410 M +22 -4 kstyles/oxygen/oxygenwindowmanager.cpp M +3 -0 kstyles/oxygen/oxygenwindowmanager.h http://commits.kde.org/kde-workspace/9ee656c206677d2ccf3dcca0079eff9bd3d91ec3 Fixed for both KDE/4.6 and master. Should work with other types of custom titlebar widgets (like menubars, statusbars and tabbars -who would do that :) ?- ) Thanks for reporting (and posting your code), very helpful ! I'd suggest you ping CraigD (http://kde-look.org/content/show.php?content=40492) about the bug report and the fix so that he copy to QtCurve (he uses the exact same code). Cheers, Hugo PS: I do remember why I grab explicitly from toolbar. It's because we have a "reduced" window grab mode that allows user to drag from empty areas in menubars and toolbars, and NOT from anywhere else. Hence the explicit grabbing. The committed patch above also works in this "reduce" mode. Thanks you very much for the quick fix!!! Hope distros will integrate it quickly :D I have pingued CraigD and link here. Br, |