From 3133d5d1c7a652a0227a979ddd6b021c4e7aa8c1 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 23 May 2019 20:58:08 +0200 Subject: [PATCH] Continue on icon loading failure If loading the icon from xpm fails, launch scrcpy without window icon. --- app/src/screen.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/screen.c b/app/src/screen.c index 8476e94f..67b268c5 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -177,13 +177,12 @@ screen_init_rendering(struct screen *screen, const char *device_name, } SDL_Surface *icon = read_xpm(icon_xpm); - if (!icon) { - LOGE("Could not load icon: %s", SDL_GetError()); - screen_destroy(screen); - return false; + if (icon) { + SDL_SetWindowIcon(screen->window, icon); + SDL_FreeSurface(icon); + } else { + LOGW("Could not load icon"); } - SDL_SetWindowIcon(screen->window, icon); - SDL_FreeSurface(icon); LOGI("Initial texture: %" PRIu16 "x%" PRIu16, frame_size.width, frame_size.height);