canonical / iot-example-graphical-snap

Developer Guide for Embedding IoT GUI with Ubuntu Frame
MIT License
22 stars 11 forks source link

The GTK3-adventure example branch doesn't work with OSK #1

Closed AlanGriffiths closed 2 years ago

AlanGriffiths commented 2 years ago

This example uses xfce4-terminal to show the colossal-cave text adventure.

I was expecting this to "just work" with Ubuntu Frame OSK, as xfce4-terminal works with the OSK when run outside a snap environment. But the OSK doesn't show.

I shared these logs with @wmww who said:

wayland-native.log wayland-snapped.log

The good one is binding to the zwp_text_input_manager_v3 global, the bad one is seeing it but the app isn't binding. I strongly suspect different version of GTK or the terminal are in use, but I suppose there could also be some environment variable/config option I don't know about.

However, this seems to be entirely down to the snap environment: after copying the environment variables from the snap and running the snapped binaries directly the OSK appears. Running devmode doesn't help: the snapped version still doesn't show the OSK.

(That probably only leaves something in the layout that differs. But what...)

AlanGriffiths commented 2 years ago

This isn't just xfce4-terminal - I tried a simplified snap with gedit and that too fails to work with the OSK. So there's something GTK related going on.

(As a sanity check, wpe-webkit-mir-kiosk does work with the OSK)

AlanGriffiths commented 2 years ago

Useful data point: the store "gedit" snap does work with OSK.

...

And the magic is somewhere in extensions: [gnome-3-38]

wmww commented 2 years ago

I think the problem is that it's not loading the Wayland IM module. this is approximately what we need, and a lot of the relevant GTK documentation is here. Playing around with it in a non-snap environment, it's quite finicky, but can be made to work.

wmww commented 2 years ago

I poked at it more and what I came up with is:

AlanGriffiths commented 2 years ago

Thanks