Add SDL_IsTraySupported
This commit is contained in:
@@ -82,6 +82,16 @@ void SDL_UpdateTrays(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool SDL_IsTraySupported(void)
|
||||
{
|
||||
if (!SDL_IsMainThread()) {
|
||||
SDL_SetError("This function should be called on the main thread");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_Tray *SDL_CreateTray(SDL_Surface *icon, const char *tooltip)
|
||||
{
|
||||
if (!SDL_IsMainThread()) {
|
||||
|
||||
@@ -29,6 +29,11 @@ void SDL_UpdateTrays(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool SDL_IsTraySupported(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_Tray *SDL_CreateTray(SDL_Surface *icon, const char *tooltip)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
|
||||
@@ -413,6 +413,24 @@ void SDL_UpdateTrays(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool SDL_IsTraySupported(void)
|
||||
{
|
||||
if (!SDL_IsMainThread()) {
|
||||
SDL_SetError("This function should be called on the main thread");
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool has_trays = false;
|
||||
static bool has_been_detected_once = false;
|
||||
|
||||
if (!has_been_detected_once) {
|
||||
has_trays = init_gtk();
|
||||
has_been_detected_once = true;
|
||||
}
|
||||
|
||||
return has_trays;
|
||||
}
|
||||
|
||||
SDL_Tray *SDL_CreateTray(SDL_Surface *icon, const char *tooltip)
|
||||
{
|
||||
if (!SDL_IsMainThread()) {
|
||||
|
||||
@@ -216,6 +216,16 @@ void SDL_UpdateTrays(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool SDL_IsTraySupported(void)
|
||||
{
|
||||
if (!SDL_IsMainThread()) {
|
||||
SDL_SetError("This function should be called on the main thread");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_Tray *SDL_CreateTray(SDL_Surface *icon, const char *tooltip)
|
||||
{
|
||||
if (!SDL_IsMainThread()) {
|
||||
|
||||
Reference in New Issue
Block a user