Skip to content

Commit 7de8db2

Browse files
committed
always respond to screensaver request
1 parent 7ac6493 commit 7de8db2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/webos/SDL_webos_init.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ int SDL_webOSRegisterApp()
7070
}
7171
if (SDL_GetHintBoolean(SDL_HINT_WEBOS_REGISTER_APP, SDL_TRUE)) {
7272
const char *appId = SDL_getenv("APPID");
73+
if (appId == NULL) {
74+
return SDL_SetError("APPID environment variable is not set");
75+
}
7376
s_nativeLifeCycleInterfaceVersion = getNativeLifeCycleInterfaceVersion(appId);
7477
if (s_nativeLifeCycleInterfaceVersion == -1) {
7578
char errbuf[1024];
@@ -271,7 +274,7 @@ static int screenSaverRequestCallback(LSHandle *sh, LSMessage *reply, HContext *
271274
(void) ctx;
272275

273276
device = SDL_GetVideoDevice();
274-
if (device == NULL || !device->suspend_screensaver) {
277+
if (device == NULL) {
275278
return 1;
276279
}
277280

@@ -288,7 +291,7 @@ static int screenSaverRequestCallback(LSHandle *sh, LSMessage *reply, HContext *
288291
}
289292
response = PBNJSON_jobject_create_var(
290293
PBNJSON_jkeyval(J_CSTR_TO_JVAL("clientName"), PBNJSON_j_cstr_to_jval((const char *)ctx->userdata)),
291-
PBNJSON_jkeyval(J_CSTR_TO_JVAL("ack"), PBNJSON_jboolean_create(0)),
294+
PBNJSON_jkeyval(J_CSTR_TO_JVAL("ack"), PBNJSON_jboolean_create(!device->suspend_screensaver)),
292295
PBNJSON_jkeyval(J_CSTR_TO_JVAL("timestamp"), timestamp),
293296
NULL);
294297

0 commit comments

Comments
 (0)