From 2683fa20ed759d523f252b01e5d45ce5833755ad Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 1 Feb 2018 15:19:35 +0100 Subject: [PATCH] Add debug log for shortcuts Add a debug log for every succeeded shortcut action. --- app/src/scrcpy.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index a78fdd48..0bd3ce8b 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -304,6 +304,7 @@ static void handle_key(const SDL_KeyboardEvent *event) { if (!fullscreen) { struct size optimal_size = get_optimal_window_size(window, frame_size); SDL_SetWindowSize(window, optimal_size.width, optimal_size.height); + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Resized to optimal size"); } return; } @@ -312,13 +313,16 @@ static void handle_key(const SDL_KeyboardEvent *event) { if (keycode == SDLK_g && !shift) { if (!fullscreen) { SDL_SetWindowSize(window, frame_size.width, frame_size.height); + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Resized to pixel-perfect"); } return; } // Ctrl+f: switch fullscreen if (keycode == SDLK_f && !shift) { - if (!switch_fullscreen()) { + if (switch_fullscreen()) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Switched to %s mode", fullscreen ? "fullscreen" : "windowed"); + } else { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Could not switch fullscreen mode: %s", SDL_GetError()); } return;