mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
unix: Refactor GTK bindings from SDL_tray to separate SDL_gtk module to allow shared usage
- SDL creates and requires usage of a specific glib context. This context is set as the global glib context with SDL_Gtk_EnterContext and the previous context is restored with SDL_Gtk_ExitContext. - To avoid changing the behavior of SDL_tray, which is the only consumer of SDL_gtk currently, the SDL_UpdateTray function now unconditionally runs a single glib frame iteration and is responsible for dispatching glib events for all consumers in SDL_PumpEvents. - Cleaned up some error handling in SDL_tray.
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
// this checks for HAVE_DBUS_DBUS_H internally.
|
||||
#include "core/linux/SDL_dbus.h"
|
||||
|
||||
#ifdef SDL_PLATFORM_UNIX
|
||||
#include "core/unix/SDL_gtk.h"
|
||||
#endif
|
||||
|
||||
#ifdef SDL_PLATFORM_EMSCRIPTEN
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
@@ -663,6 +667,10 @@ void SDL_Quit(void)
|
||||
SDL_DBus_Quit();
|
||||
#endif
|
||||
|
||||
#ifdef SDL_PLATFORM_UNIX
|
||||
SDL_Gtk_Quit();
|
||||
#endif
|
||||
|
||||
SDL_QuitTimers();
|
||||
SDL_QuitAsyncIO();
|
||||
|
||||
|
Reference in New Issue
Block a user