mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 14:24:57 +08:00
unix: Factor out the check for GTK into an internal function
This will allow the same check to be done by the libdecor integration. Helps: https://github.com/libsdl-org/sdl2-compat/issues/564 Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
committed by
Sam Lantinga
parent
76352f2931
commit
9e0b31b297
+10
-1
@@ -81,12 +81,21 @@ static bool IsGtkInit()
|
|||||||
return libgdk != NULL && libgtk != NULL;
|
return libgdk != NULL && libgtk != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool InitGtk(void)
|
bool SDL_CanUseGtk(void)
|
||||||
{
|
{
|
||||||
if (!SDL_GetHintBoolean("SDL_ENABLE_GTK", true)) {
|
if (!SDL_GetHintBoolean("SDL_ENABLE_GTK", true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool InitGtk(void)
|
||||||
|
{
|
||||||
|
if (!SDL_CanUseGtk()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsGtkInit()) {
|
if (IsGtkInit()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ typedef struct SDL_GtkContext
|
|||||||
} gtk;
|
} gtk;
|
||||||
} SDL_GtkContext;
|
} SDL_GtkContext;
|
||||||
|
|
||||||
|
extern bool SDL_CanUseGtk(void);
|
||||||
extern bool SDL_Gtk_Init(void);
|
extern bool SDL_Gtk_Init(void);
|
||||||
extern void SDL_Gtk_Quit(void);
|
extern void SDL_Gtk_Quit(void);
|
||||||
extern SDL_GtkContext *SDL_Gtk_EnterContext(void);
|
extern SDL_GtkContext *SDL_Gtk_EnterContext(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user