SNAP using SDL2 is not receiving Text Input

Hi there. I am having the following problem with my snap app, I hope someone can throw some light to it because it is stopping its release for some days now.

The app is based on SDL2 libraries, and has been working fine until now. But now I am using SDL_TEXTINPUT instead of SDL_KEYDOWN (which I still use) for text inputting. And basically the app is totally unresponsive to it.

If I run the snap with su privilege it does work, so it seems to be snap packaging issue, but I already included this plugs, which should be sufficient:
plugs: [network, network-bind, x11, opengl, home, desktop, audio-playback, unity7]

I tried to include desktop-legacy & wayland, without any difference.

Using snappy-debug, I get the following output for regular user:

= Seccomp =
Time: Sep 16 11:52:22
Log: auid=1000 uid=1000 gid=1000 ses=3 pid=61780 comm="PulseHotplug" exe="/snap/vmanager/x2/bin/vmanager" sig=0 arch=c000003e 141(setpriority) compat=0 ip=0x7fb480086e67 code=0x50000
Syscall: setpriority
Suggestion:
* ignore the denial if the program otherwise works correctly (unconditial setpriority is often just noise)

= Seccomp =
Time: Sep 16 11:52:22
Log: auid=1000 uid=1000 gid=1000 ses=3 pid=61780 comm="SDLAudioDev1" exe="/snap/vmanager/x2/bin/vmanager" sig=0 arch=c000003e 141(setpriority) compat=0 ip=0x7fb480086e67 code=0x50000
Syscall: setpriority
Suggestion:
* ignore the denial if the program otherwise works correctly (unconditial setpriority is often just noise)

Any idea on what is going on? Many thanks.

do you use any desktop launcher or extension in your snap ?

Yes, the .desktop file is as follows:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Test
Comment=Description
Exec=test
Icon=${SNAP}/resources/icon/test.png
Terminal=false

heh, i meant a desktop-launch script wrapper to run your app in the command: line of your snapcraft.yaml (this usually sets up the required environment variables and ships the correct libs to run an app on a desktop)

Oh, no. In my command: line I do not specify anything like that. I was unaware of that possibility.

Mine looks like that:

apps:
  test:
    command: test
    plugs: [network, network-bind, x11, opengl, home, desktop, audio-playback, unity7]

I will look into it, so as I understand, I should be able to add a desktop-lunch to lunch from the command line alongside my app??

yes, to have your app properly interact with the running desktop environment you will either need to use an extension (like gnome-3-38 for core20 based snaps (see: snapcraft list-extensions for a list of available ones) or one of the older desktop launchers from:

(see the description in that snapcraft.yaml about how to use them)

1 Like

Many thanks! It was the first time I was editing that snap build process, it was a bit outdated so took me quite a bit to read all the info and do the proper changes. But that was definitely the solution to aim for.

Thanks again!

1 Like