diff options
author | Jindrich Makovicka <makovick@gmail.com> | 2017-11-17 12:22:56 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-01-12 15:50:43 +0100 |
commit | 2821671629531184d9fa2f8fcc3cea1bd605b872 (patch) | |
tree | 5ccd9534a2845fe5bed8d2b442818820de88846f /ui/sdl2.c | |
parent | abda4766815af3db3c3c43fa96a45d935e2b217a (diff) | |
download | qemu-2821671629531184d9fa2f8fcc3cea1bd605b872.zip qemu-2821671629531184d9fa2f8fcc3cea1bd605b872.tar.gz qemu-2821671629531184d9fa2f8fcc3cea1bd605b872.tar.bz2 |
sdl2: Do not hide the cursor on auxilliary windows
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Message-Id: <20171117112258.5888-2-makovick@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r-- | ui/sdl2.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -466,6 +466,10 @@ static void handle_mousemotion(SDL_Event *ev) int max_x, max_y; struct sdl2_console *scon = get_scon_from_window(ev->key.windowID); + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (qemu_input_is_absolute() || absolute_enabled) { int scr_w, scr_h; SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h); @@ -494,6 +498,10 @@ static void handle_mousebutton(SDL_Event *ev) SDL_MouseButtonEvent *bev; struct sdl2_console *scon = get_scon_from_window(ev->key.windowID); + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + bev = &ev->button; if (!gui_grab && !qemu_input_is_absolute()) { if (ev->type == SDL_MOUSEBUTTONUP && bev->button == SDL_BUTTON_LEFT) { @@ -516,6 +524,10 @@ static void handle_mousewheel(SDL_Event *ev) SDL_MouseWheelEvent *wev = &ev->wheel; InputButton btn; + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (wev->y > 0) { btn = INPUT_BUTTON_WHEEL_UP; } else if (wev->y < 0) { @@ -657,6 +669,11 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl, int x, int y, int on) { struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl); + + if (!qemu_console_is_graphic(scon->dcl.con)) { + return; + } + if (on) { if (!guest_cursor) { sdl_show_cursor(); |