s-victor / TinyPedal

Free and Open Source telemetry overlay application for racing simulation
GNU General Public License v3.0
75 stars 8 forks source link

Linux - Wayland support #30

Closed alexbrrsclnt closed 5 months ago

alexbrrsclnt commented 10 months ago

The app launches without issues, but the widgets don't respect the position set in the respective configuration section. Also is not possible to drag&drop widgets. And finally (and maybe this is a KDE environment issue), each widget has a window task entry in the task bar.

tinipedal_wayland_widgets_position

In KDE preferences > Window managment section, you can set the location of the windows, the default is centered. If you change this setting, after toggle autohide option in the app to hide and show them again, the widgets respect that instead of the position set in the app. I don't know if this is a KDE wayland issue or is also present in other environments like Gnome.

kde_preferences_window_management

If this issue is solved, the app would be perfect and ready for when X11 is disabled definitely in linux.

Thanks for the app!

s-victor commented 10 months ago

Hi, thanks for the feedback. KDE is known to have various issues with drag-ability & task icon problems from my previous testing. I had spent quite some time trying to fix those issues you mentioned on fedora KDE some months ago, but there was no success in solving them. At the moment there isn't anything I can do to help with the issue related to KDE. Other DE like gnome, lxde, xfce should work fine.

s-victor commented 10 months ago

I have a very good news.

Just found a solution from this post which solved dragging and position issues as I tested on fedora KDE (wayland).

You will need to run tinypedal with following cmd: XDG_SESSION_TYPE=x11 python3 run.py

Please let me know if it works on your side too @alexbrrsclnt @berarma

Thanks.

Edit, the other solution also works as it seems: QT_QPA_PLATFORM=xcb python3 run.py

Also, once launched, you may only see one widget, and need to click it to see other widgets.

alexbrrsclnt commented 10 months ago

I will try both methods and report back!

Thanks!

berarma commented 10 months ago

Gnome on Wayland has the same issues. Both workarounds work although I haven't tested them enough. I don't have rFactor 2 installed on this computer.

I have yet to test it on my main computer with Gnome on X11 to see there's no regressions there.

We can add one of those workarounds to the launcher if it doesn't break anything else.

alexbrrsclnt commented 10 months ago

I have tried both methods on KDE wayland and both work. But I don't know if this is a proper fix or a temporarily "hack". I think that if not yet, soon there must be a proper way to create "windows" or "panels" for widgets that not need to think that are in a X11 environment instead of a wayland one.

Maybe it's fine to keep this issue open until a proper fix is found, but advertise that a intermediate solution is available in the README.

Thanks!

EDIT: for the record, I have not tried to launch the app with that prefix on a X11 session, but I don't think that telling an X11 app that is going to be executed in an X11 session would suppose any regression :P

berarma commented 10 months ago

EDIT: for the record, I have not tried to launch the app with that prefix on a X11 session, but I don't think that telling an X11 app that is going to be executed in an X11 session would suppose any regression :P

Not for the first workaround, but I don't know exactly what the second workaround does. For that reason I would choose the first one if possible.

As for fixing it for Wayland, this probably implies upgrading to PySide2/QT 6. It would make it a bit harder to install on some systems still using QT5 and maybe bring other issues.

s-victor commented 10 months ago

Thank you guys for the feedback.

According to qt document in this link, this issue seems unlikely be "fixed". There were also some search results shown the same issue dated way back to 10 years ago...

Agree with berarma's concern. I did test with both pyside2(qt5) & pyside6(qt6) for various compatibility concerns long before, and both shown same results. So pyside2 was chose at the end for better compatibility with old system.

Once you decided, please feel free to make a PR with the workaround integrated in launcher. Thanks for help.

berarma commented 10 months ago

I've implemented a fix in #32, please test and report back. Thanks!

alexbrrsclnt commented 10 months ago

I've implemented a fix in #32, please test and report back. Thanks!

Sure, I Will try ASAP!

berarma commented 10 months ago

It's already merged so just need to pull the newest commits from master.

s-victor commented 10 months ago

Just tested new installer & launcher, works perfect in vbox, great job @berarma

s-victor commented 10 months ago

hi, I just noticed a small issue in new installer.

If the install destination doesn't already contain share share/applications bin folders, it will throw insufficient privileges and fail to install, probably need some extra code to create folder if not exist?

berarma commented 10 months ago

hi, I just noticed a small issue in new installer.

If the install destination doesn't already contain share share/applications bin folders, it will throw insufficient privileges and fail to install, probably need some extra code to create folder if not exist?

That's done on purpose, the choosen directory should contain the structure since we're just setting the prefix. Although I should have shown a different error message.

I can change it to create them or add a better error message. If you think there's a use case I would create them, if not I think it's a protection to avoid installing them in the wrong location.

s-victor commented 10 months ago

All good no worries, thanks for explanation.

alexbrrsclnt commented 10 months ago

Reinstalled from latest master and works perfectly.

Thanks!