|
|
|
@ -2,10 +2,12 @@
|
|
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include <SDL2/SDL_keycode.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
#include "input_events.h"
|
|
|
|
|
#include "screen.h"
|
|
|
|
|
#include "util/log.h"
|
|
|
|
|
#include "util/thread.h"
|
|
|
|
|
|
|
|
|
|
#define SC_SDL_SHORTCUT_MODS_MASK (KMOD_CTRL | KMOD_ALT | KMOD_GUI)
|
|
|
|
|
|
|
|
|
@ -397,6 +399,18 @@ inverse_point(struct sc_point point, struct sc_size size,
|
|
|
|
|
return point;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
run_window_restore(void *data) {
|
|
|
|
|
struct sc_screen *screen = data;
|
|
|
|
|
|
|
|
|
|
getchar();
|
|
|
|
|
|
|
|
|
|
sc_screen_show_window(screen);
|
|
|
|
|
printf("Window resumed\n");
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
sc_input_manager_process_key(struct sc_input_manager *im,
|
|
|
|
|
const SDL_KeyboardEvent *event) {
|
|
|
|
@ -575,6 +589,21 @@ sc_input_manager_process_key(struct sc_input_manager *im,
|
|
|
|
|
open_hard_keyboard_settings(im);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
case SDLK_d:
|
|
|
|
|
if (!shift && !repeat && down && !im->screen->hidden) {
|
|
|
|
|
sc_screen_hide_window(im->screen);
|
|
|
|
|
|
|
|
|
|
printf("Window hidden, press [Enter] to restore...\n");
|
|
|
|
|
|
|
|
|
|
sc_thread thread;
|
|
|
|
|
bool ok = sc_thread_create(&thread, run_window_restore, "scrcpy-hidden-screen", im->screen);
|
|
|
|
|
if (!ok) {
|
|
|
|
|
LOGE("Could not start window restore thread");
|
|
|
|
|
sc_screen_show_window(im->screen);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|