Phosh app developer forum?

Thanks for explaining how it currently works!

This won’t fly on Wayland as for regular apps you have no control/knowledge where the surface actually is on the screen. Even in “fullscreen” the compositor could place the the surface at some offset. Also /dev/input needs special privileges (try libinput debug-events as regular user). What you want to use to make your app work well under Wayland are wl_touch events: Appendix A. Wayland Protocol Specification. This gives you surface local coordinates (rather than output global) and your app will work in fullscreen and windowed (what you’re seeing here is not phosh/phoc specific, it’s basically how Wayland works).

Calls to Window.fullscreen() now will no longer restore fullscreen mode which fixes the touch calibration problem.

You can fullscreen / unfullscreen apps multiple times just fine (check e.g. with livi or epiphany). When do you make the call to fullscreen? When receiving touch events again after unfullscreen()? I’d be surprised it that wouldn’t work. (Judging from the screenshots it seems that you’re running a pretty old version of phosh/phoc which might affect behavior)

So if you can’t use Wayland native events trying harder to fullscreen again or placing a large enough button (so that the offset doesn’t matter) on the screen to fullscreen again are the only things I can think off to work around the fact that you’re using /dev/input.

EDIT: depending on how much UI elements you have switching to e.g. Python + GTK/libadwaita could make sense. This makes things work on Wayland and X11 out of the box. But likely this is already too late in you app development cycle.

3 Likes

Kivy does not support native Wayland events. 95% of my code is Kivy specific so changing libraries would be a complete rewrite.

Screenshot at 2024-12-14 07-05-52

I am aiming for the platform trifecta of Android, iOS, Linux Mobile, and Windows Surface. I have it working on all but iOS except Phosh causes a touch screen calibration issue.

Oh well.

Thanks for the advice.

1 Like

Can’t help here, it is kivy that lacks support for anything reasonable on Linux. We can’t support toolkits that try to map /dev/input to screen coordinates in 2024, sorry. From looking at kivy it seems to do more reasonable things on other platforms.You can work around as outlined above.

2 Likes

Kivy uses SDL2 and OpenGL 2.0 as its base. It relies on those two standards as its basis for cross-platform support.

I know of no efforts underway to make Wayland a backend for Kivy, although such a feature would be be nice for improving compatibility on Linux since everything is heading toward Wayland.

I am married to the cross-platform ideology and Python so the only alternative was BeeWare which still remains too green for my liking.

Do you have any thoughts on BeeWare? BeeWare seems too green to me. Kivy blows it away when it comes to documentation and Internet information. Kivy has about a dozen books written on it while I cannot find a single book on BeeWare.

Thanks for the advice. I appreciate it.

1 Like

Kivy uses SDL2 and OpenGL 2.0 as its base. It relies on those two standards as its basis for cross-platform support.

SDL2 supports wl_touch so there wouldn’t be a need for anything else when you could at least use Wayland but I don’t think that is possible with kivy atm.

It’s the first time I’m hearing about beeware so I can’t say how useful it is, sorry.

I personally find all cross platform toolkits that don’t map to a native windowing toolkit on the platform (so e.g. Qt or GTK on Linux) don’t integrate well into the whole system so they always look (and behave) alien.

2 Likes

I don’t disagree with you about the alien opinion. When you do cross platform you program to the lowest common denominator.

I do have Android and Phosh behaving 99% the same at this point from the end user perspective so that is something.

2 Likes

Would Xwayland not partially address that?

1 Like

This is what @coryholl 's current implementation is using with the problems discussed above.

3 Likes

Boo wayland. :heart: X11

3 Likes

+1
X11 :heart:

1 Like

Wayland’s got some good compatibility features. Can OP try to see if there are any XWayland support libs that can help fix the issue? If so, bundle it into a flatpak or Appimage and call it a day.

1 Like