Maproom / qmapshack

Consumer grade GIS software
GNU General Public License v3.0
297 stars 64 forks source link

Can't return sidebar windows to sidebar (Plasma Wayland) #691

Closed yaomtc closed 1 week ago

yaomtc commented 2 weeks ago

Describe the bug

When using Plasma Wayland, and I click the diamond button (this should have a tooltip; a more helpful icon is used on GNOME) on a sidebar widget, a window is created, but there's no button on the window to return it to the sidebar.

What have you done to circle down the problem?

I searched here a bit and couldn't find anyone mentioning this. I've tested on X11, and it works fine there, the diamond buttons are there on the window. GNOME doesn't have this issue with Wayland, as shown in my comment below.

Screenshots

On Wayland:

Screenshot_20241028_072102

On X11:

Screenshot_20241028_073231

Desktop

yaomtc commented 2 weeks ago

Just checked GNOME (Wayland) and it does not have this issue. Also, what appears as a diamond button under Plasma has a more helpful "windows" icon under GNOME. So this issue is specific to kwin_wayland (Plasma's default since 6.0)

Screenshot From 2024-10-28 22-12-27

Screenshot From 2024-10-28 22-12-55

kiozen commented 2 weeks ago

These are a dock widgets. A very established element in GUI programming, dating back ages. I think they came up in the Windows 95 era. Simply grab the widgets toolbar with your mouse (left button kept pressed) and move them either to the left ore the right side of QMapShack's main window (top and bottom work too). You will notice when they are in the focus of the dock are.

You can even move the dock widgets up and down in the dock area or stack them. By that you can optimize the space of the main window. This is also explained and depicted in the quick help when you add a new map view (strg+t or Menu->View->Add map view)

The eye candy of these dock widget' title bar is subject to your window manager/theme as you already noticed. Some are a bit less cryptic than others. But that is nothing we can influence.

I for instance use only the dock area at the left side. I have two stacks of dock widgets. The top one with the routing and workspace dock widgets. The bottom one with maps, DEM, and the database dock widgets. All other widgets are hidden as I do not really use them.

Additionally I moved the tool bar (also a dock widget) to the left side. But you can place it to any other side as you prefer.

yaomtc commented 2 weeks ago

@kiozen No:

https://github.com/user-attachments/assets/6a8350c1-efd9-4488-8375-89702adfec51

kiozen commented 2 weeks ago

Ok tested it on my machine. It's a Qt/Wayland problem. These are the reasons why I switch back to X11 within a couple of minutes every time I give Wayland a try.

There seem to be similar issues for other apps:

https://github.com/dail8859/NotepadNext/issues/451

As suggested in the link I tried it with the Qt6 port of QMapShack inside Weston. It works but the behavior is still quite peculiar and not what you expect. The loose dock widget does not move when grabbed but if you ignore that and move the mouse you can dock it again.

Let's see if we wait another decade Wayland may get an option.

kkarsten62 commented 2 weeks ago

I can confirm this behavior for Fedora 40 Workstation with Wayland also.

Bypass is to rename or delete ~/.config/QLandkarte directory. After restart of QMS you can rearrange/dock the windows again. But only once - so you have only one try for each window!

Or stick to X11 as long as you can ...

yaomtc commented 2 weeks ago

GNOME lacks this issue, I wonder why? QMapShack is still using Qt even there, right? Not GTK

kkarsten62 commented 2 weeks ago

Fedora 41 is just released with Gnome 47. I set up a fresh VM. grafik Then I give it a try and compiled it against the QMS qt6 branch. grafik

Good news - progress is showing. On a first view, docking works as expected :-)

kiozen commented 2 weeks ago

Yes, it's pure QT. No GTK. The dock widget stuff is partly window manager related. That's why the icons differ etc. And the window manger has to send events that the detached widget is now close to the dock widget etc. And these events have to be processed again into some Wayland directives, etc. This seems to be handled by plugins in Qt. There are several for different graphic front ends. As far as I understand the plugin in QT5 has a bug that is kind of fixed in latest versions of Qt6.

Probably that is the reason why the user experience is so shitty in Wayland. Because several players have to match: Wayland, window manager, GUI tool kit. Any mismatch is a bug and hard to assign to the different projects maintaining these components. For each bug it would need an expert to find out the real root cause. Not going to happen. Therefore progress is slow. Wayland started in 2008 and is still a pain in the ass in 2024. And it will take even longer to get it as perfect as X11.

yaomtc commented 2 weeks ago

OK, I built the qt6 version and the docking/undocking button works on Plasma too!

Here's the PKGBUILD if anyone wants to use it. Not sure if I should submit it to the AUR, considering this will only be useful for a tiny number of people and only until the porting process is done. (And like the qmapshack-git PKGBUILD it's based on, there's no application launcher or icon, unlike the official QMapShack Arch package, so I have to launch it from terminal)

https://gist.github.com/yaomtc/211a8e361aba1d6fa60d762906306b29