Short question is, is there a way I can get an SDL3 event when data is written into a pipe? or some other inter process signal? I have a solution using SIGUSR1 on linux but I’m looking for something better.
Long version: I wrote a program that does a fuzzy search on my music collection, and lets me play the song or album (external program, either mpd or vlc). When the window loses focus (or when I choose something) the window is hidden (SDL_HideWindow). I use SDL_WaitEvent so I don’t spin. How do I show the window once it’s hidden? My current solution is having a global hotkey run a script that either launches the process or sends user1 signal, my previous solution (diff app) did a file lock on a named pipe and wrote data when it wanted the app to show again.
For the signal, I use SDL_PushEvent in the signal handler, for the pipe solution I used SDL_WaitEventTimeout with 100ms, and would check the pipe every time. Is there a better solution? I ran my program with strace and it looks like there’s a poll on two unix sockets, but I’m not sure if I can do something with that to create an event? Even a no op would be helpful