mirror of https://github.com/libsdl-org/SDL.git
Check for non-NULL icon for trays on Unix
This commit is contained in:
parent
b03332b68d
commit
e6029401d9
|
|
@ -421,12 +421,14 @@ SDL_Tray *SDL_CreateTray(SDL_Surface *icon, const char *tooltip)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!new_tmp_filename(tray)) {
|
if (icon) {
|
||||||
SDL_free(tray);
|
if (!new_tmp_filename(tray)) {
|
||||||
return NULL;
|
SDL_free(tray);
|
||||||
}
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_SaveBMP(icon, tray->icon_path);
|
SDL_SaveBMP(icon, tray->icon_path);
|
||||||
|
}
|
||||||
|
|
||||||
tray->indicator = app_indicator_new(get_appindicator_id(), tray->icon_path,
|
tray->indicator = app_indicator_new(get_appindicator_id(), tray->icon_path,
|
||||||
APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
|
APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue