-
Notifications
You must be signed in to change notification settings - Fork 662
fix docking drag drop problem on Linux wayland #789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
580fadf to
3ea60f1
Compare
3ea60f1 to
5a91b12
Compare
|
that is awesome! My app forces X11 on boot because of that issue |
|
Good catch with See qt-creator-ads-wayland.mp4 showcasing that it works. This resulted from the information at #714 where we have a link to Use platform drags for drags of docks and toolbars on wayland It only works when dragging a tab and letting it go, then you can drag it again. If you double click, the drag information is missing and can't bring it back. Also the overlay buttons don't react to the drop, they would have to accept this too. |
Thanks for informing me. It looks fantastic. The only imperfection is that we can not drag the part of overlay with Qt::Tooltip out of the screen, unlike the normal overlay window. I have no idea whether is Qt implements or wayland limitation. I have a brief glance on source code about QWidget. It's complex for me to figure out. This is not a critical issue with double clicking undock. We can disable this feature on wayland automatically and talk to the developer in the document. Would you like to give a PR with a full patch to this repo? I will close it if you do. |
Feel free to implement the same feature in this PR or a subsequent PR. Qt Creator has a fork of ADS, and the fork works as seen in the screencast. I have tried the same thing with upstream ADS and didn't work in the same way. The floating window disappeared while trying to move it. |
OK. I merge your changes and test the codes. Floating window can create successfully. But I move the floating window, the dock overlay cannot work properly and I have no idea about it. Can you give me some tips? The reason why floating window disappeared is that QtAds try to set Qt::WindowStaysOnTopHint on it. Here are some comments on
Yes, same the problem on Wayland too. Just remove all else branch about |
|
Just mentioning that the PR code uses spaces for indentation when it should use tabs for indentation, like the rest of the codebase. |
Hello, I fix the drag drop problem on wayland. Here is the screenshot before applying this patch:
Due to wayland limitation, frameless window can not reposition by programing. That's why will break up dragging and droping dock widget. I open debugging console on wayland and the screenshot as following:
As we can see from the image, we create many dialogs and set these frameless so
QWidget::movenot work on wayland.While
Qt::ToolequalsQt::Popup | Qt::Dialog,Qt::ToolTipis same asQt::Popup | Qt::Sheet.Qt::Sheetis used for MacOS. I changedQt::Tool | Qt::FramelessWindowHinttoQt::ToolTipand drag-and-drop works very well:So, why? I dive into wayland protocol and found the reason.
When set
Qt::ToolTipatrribute to a widget. Qt will create aXdgPopupWindowobject:According to protocol,
xdg_popuphave the ability to reposition. So we can use theQt::ToolTipatrribute to solve the problem.However, floating window is still broken on wayland. It will crash the APP surface:
Also, it works well on Linux X11 (no change on Windows), tested with Qt6.10. This may a good solution for wayland native who don't need floating windows.