docking of Notes Window not possible
I use latest git vym (Version 2.9.31, Qt version 5.15.15. ) on ubuntu / wayland.
the note window is floating and i can't attache it to the main window. when i delete the config files, one time, i can detache it but can't attach it again.
Usually you can grab it at the top bar and move it around. When hovering aobve/below/besides of MapEditor widget you should be able to drop it back into the main window. Doesn't work?
i tryed everything, but this does not work on my ubuntu (wayland)
Hm, I am surprised that your floating NoteEditor does not have the control buttons in the upper right corner, see my screenshot. I am using KDE on openSUSE. This might be a window manager issue, as the WM controls where buttons are placed AFAIK.
Don't have an Ubuntu here, so cannot really test :-(
Do you see this effect every time you detach the NoteEditor? How do you detach?
Btw. no need to delete the whole config file, removing the "state" entry below [mainwindow] should do the trick.
If you are familiar with compiling, you could also try out the develop branch, which uses Qt 6.
Disclaimer: vym 2.9.522 is pretty usable already, but old versions cannot read the new format At the moment sometimes crashes, which I cannot reliably reproduce yet :-(
i use sway, in sway, there are no control buttons in the upper right corner. thats ok.
i have to delete the config file, after that, i can move the NoteEditor window from one frame to another but if i put out, i can't put it back.
i tryed with the latest git version. Version 2.9.31 and Qt version 5.15.15.
maybe i should switch to qt6?
I am not sure if Qt6 really makes much of a difference here... Unfortunately I cannot reproduce the issue on all my systems. In the past I remember to have seen something like it, but not for a long time now. OTOH I am working with the development for most of the year already. I'd say give it a try, if you can. I probably also start building Ubuntu packages in the next few weeks in OBS.
Hey, I do reproduce that on Wayland also. No handle, and no way to dock windows once they are detached as separate windows. It works fine on Xorg, but not on my Wayland (using labwc at the moment). @insilmaril , are you currently using Xorg or Wayland? And if Wayland, which compositor? Thanks.
Currently I am basically only on Mac :-(
I try to get back to Linux soonish and resetup a Windows Machine, if I can get hold of one.
Still this looks like a Qt or WM topic, vym itself doesn't care about the platform, at least not regarding window logic.
Maybe searching for Qt <-> Wayland issues brings up something?
I can try to dig that myself, but I am not super knowledgable with Qt. Maybe you can tell me which "widgets" are supposed to be undockable (moved to new window)? Because I suppose you have used a native Qt widget which has that property of being docked or not? This information could help me find help on the topic. Thanks a lot in advance.
Thanks - that would be QDockWidget. https://doc.qt.io/qt-6/qdockwidget.html
I see that Vym is currently using Qt version 6.4.2.
I have found a bug that affects versions starting from 5.15.0:
QTBUG-87332 – QDockWidget on Wayland is pretty bad: not redockable, does not visually move when moving
https://bugreports.qt.io/browse/QTBUG-87332
This ticket describes exactly what we are seeing: after undocking on Wayland, the dock becomes a separate window and redocking (with visual indicators) does not work because Qt historically relied on global coordinates, which Wayland does not expose. It also mentions that there is no visual feedback while dragging.
Qt marks this bug as fixed in versions 6.5.4 and 6.6.0.
I also found this other bug:
QTBUG-138339 – Dock widgets not working as expected on Wayland
https://bugreports.qt.io/browse/QTBUG-138339
This affects versions 6.8.3, 6.9.0, and 6.9.1 and has not been fixed yet.
And another one:
QTBUG-136011 – Floating QDockWidget cannot be dragged on Wayland
https://bugreports.qt.io/browse/QTBUG-136011
This affects versions 6.8.2, 6.9.0, and 6.9.1 and has also not been fixed yet.
Therefore, upgrading the Qt version used by Vym could help resolve the issue. Based on the above bugs, a good version to upgrade to might be 6.8.1, in order to benefit from the fixes while avoiding the more recent regressions.
More generally, I reviewed the release notes after 6.4.2 and found several items that might be relevant in the context of Vym. This reinforces the idea that upgrading Qt could resolve multiple Wayland-related issues:
- QTBUG-119024 – Window position is bypassed by Wayland
- QTBUG-120392 – QWayland CSD window has unclickable area
- QTBUG-115598 – tst_QWidget::render() with QtWayland failed on Ubuntu 22.04, GNOME
- QTBUG-123007 – Under Wayland Qt does not correctly handle key modifiers during key repeating
- QTBUG-125531 – Unable to drag files into the xwayland widget of QTextEdit
- QTBUG-126275 – [REG Qt 6.6.3 → 6.7.0] Wayland: Can't scroll with mousewheel in editor
- QTBUG-129362 – tst_QDockWidget::setFloating() failed on GNOME Wayland (Ubuntu 24.04 and 22.04)
- QTBUG-130652 – [REG] Hiding and reshowing a sub-window crashes Wayland client
- QTBUG-66818 – tst_QWindow::initialSize fails on Wayland
- QTBUG-97037 – DragHandler / startSystemMove window move issue with Qt6 WebEngine on Wayland
Ah, thanks a lot for the investigation. I guess there's not much we could do right now wit Wayland. :-(
If Qt could detect Wayland, maybe a warning window and a reference to this issue here might be something to add. Opinions?
THoush I have no clue how to detect wayland from within an app...
Hmm, not sure I understand.
To me, if we migrate from Qt 6.4.2 to Qt 6.8.1, it would solve the problem. Are you saying that upgrading Qt would be a hard task, so it might not be easily doable?
Otherwise, some workarounds could be to propose a menu action to reattach (sorry if the code is not accurate, this is just a rough example):
QAction* reattach = menu->addAction("Reattach");
connect(reattach, &QAction::triggered, this, [dock]{
dock->setFloating(false);
});
Or maybe, as you say, prevent floating on Wayland with something such as:
const bool onWayland = (qApp->platformName() == "wayland");
if (onWayland) {
dock->setFeatures(dock->features() & ~QDockWidget::DockWidgetFloatable);
}
But those are only workarounds. The cleanest would be just upgrade to Qt 6.8.1 as problems are normally fixed for Wayland there (from what I have read on changelogs).
Indeed I'd go for updating Qt. On Linux there are several options:
- use packages provided by distribution. I ususally run openSUSE Leap, would have to check what that will be soon in 16.0. Usually distributors tend not to have the latest Qt version (6.9x I think)
- Using Qt Creator and Qt maintenance tool an update is usually pretty trivial, though I have not used that on Linux so far, only Mac and Windows.
- Worst case one maybe would have to rebuild Qt itself.
Hope that helps :-)
I have built Qt 6.9.2 locally on my system, and this has taken ages :)
But I confirm the bug reported above with that build, which is that I cannot drag and move detached windows... So it is actually even worse than with 6.4.2 for me.
QTBUG-136011 – Floating QDockWidget cannot be dragged on Wayland
I have also found a precompiled version of Qt 6.8.1 that I found online, and I thought that this bug of not being able to drag would not be present yet on that version. But this is, in fact, the same as with Qt 6.9.2.
So I don't have a solution for finding a Qt version that works correctly. I believe we have to wait for Qt to correct that bug.
Or maybe implement the workaround that allows re-docking the window with an action in the menu, or something like that.