From c9110cd30d6efd42de07b357ff144d5ccacb2541 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Thu, 4 Nov 2021 11:23:12 +0000 Subject: Have library control window creation This allows for the library to create a window of the correct size, and will also allow for future updates that have the client automatically resize the window (perhaps when receiving a desktop-size pseudoencoding). --- SDL2_vnc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'SDL2_vnc.c') diff --git a/SDL2_vnc.c b/SDL2_vnc.c index 6afedfc..4988aa6 100644 --- a/SDL2_vnc.c +++ b/SDL2_vnc.c @@ -955,3 +955,14 @@ int key_event(SDL_vnc *vnc, bool pressed, SDL_Keysym sym) { to_server(vnc->socket, buf, 8); } + +SDL_Window *create_window_for_connection(SDL_vnc *vnc, char *title, int x, + int y, Uint32 flags) { + + vnc->window = SDL_CreateWindow(title, x, y, vnc->server_details.w, + vnc->server_details.h, flags); + + SDL_ShowCursor(SDL_DISABLE); + + return vnc->window; +} -- cgit v1.2.1