Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Expose registered games on the bus #155
For the Shell extension (or a little separate tool) as well as future integration with GNOME Usage I wanted to get the list of currently registered games from gamemoded. For this I added to the
As well as a new
This should make it possible for a client to track all currently registered games (start listening to the signals, list the current active ones and track changes via the signals).
In order to expose the individual games, I opted for expose the
This is so it can out-live its membership in the client list, e.g. when it is passed outside of gamemode-context.c and the reaper comes along and reaps a client in the background but we still are using the struct outside.
Now that GameModeClient is reference counted, the counterpart to game_mode_client_unref is also needed.
Add getters for all two properties of GameModeCLient: the process id and the executable path.
Return an array of pid_t elements containing the process ids of all registered clients. Memory ownership is transferred to the client and must be freed.
For each registered game, export an object on the bus under the path "/com/feralinteractive/GameMode/Games/<pid>" with an dbus interface of ""com.feralinteractive.GameMode.Game". The interface currently provides to properties, ProcessId and Executable. Additionally add the ListGames method and the GameRegistered, GameUnregistered signals to the com.feralinteractive.GameMode interface.