Make screen event handler return void

The function always returned true.
This commit is contained in:
Romain Vimont
2026-02-05 09:17:18 +01:00
parent 77998f543f
commit d7f0e22067
3 changed files with 11 additions and 13 deletions

View File

@@ -199,8 +199,8 @@ event_loop(struct scrcpy *s, bool has_screen) {
break;
}
default:
if (has_screen && !sc_screen_handle_event(&s->screen, &event)) {
return SCRCPY_EXIT_FAILURE;
if (has_screen) {
sc_screen_handle_event(&s->screen, &event);
}
break;
}

View File

@@ -854,7 +854,7 @@ sc_screen_resize_to_pixel_perfect(struct sc_screen *screen) {
content_size.height);
}
bool
void
sc_screen_handle_event(struct sc_screen *screen, const SDL_Event *event) {
// !video implies !has_video_window
assert(screen->video || !screen->has_video_window);
@@ -864,28 +864,28 @@ sc_screen_handle_event(struct sc_screen *screen, const SDL_Event *event) {
if (!ok) {
LOGE("Frame update failed\n");
}
return true;
return;
}
case SDL_EVENT_WINDOW_EXPOSED:
if (!screen->video || screen->has_video_window) {
sc_screen_render(screen, true);
}
return true;
return;
case SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED:
if (screen->has_video_window) {
sc_screen_render(screen, true);
}
return true;
return;
case SDL_EVENT_WINDOW_RESTORED:
if (screen->has_video_window && is_windowed(screen)) {
apply_pending_resize(screen);
sc_screen_render(screen, true);
}
return true;
return;
case SDL_EVENT_WINDOW_ENTER_FULLSCREEN:
LOGD("Switched to fullscreen mode");
assert(screen->has_video_window);
return true;
return;
case SDL_EVENT_WINDOW_LEAVE_FULLSCREEN:
LOGD("Switched to windowed mode");
assert(screen->has_video_window);
@@ -893,17 +893,16 @@ sc_screen_handle_event(struct sc_screen *screen, const SDL_Event *event) {
apply_pending_resize(screen);
sc_screen_render(screen, true);
}
return true;
return;
}
if (sc_screen_is_relative_mode(screen)
&& sc_mouse_capture_handle_event(&screen->mc, event)) {
// The mouse capture handler consumed the event
return true;
return;
}
sc_input_manager_handle_event(&screen->im, event);
return true;
}
struct sc_point

View File

@@ -157,8 +157,7 @@ void
sc_screen_set_paused(struct sc_screen *screen, bool paused);
// react to SDL events
// If this function returns false, scrcpy must exit with an error.
bool
void
sc_screen_handle_event(struct sc_screen *screen, const SDL_Event *event);
// convert point from window coordinates to frame coordinates