[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 7/9] sdl2: Do not hide the cursor on auxilliary windo
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 7/9] sdl2: Do not hide the cursor on auxilliary windows |
Date: |
Fri, 12 Jan 2018 15:52:56 +0100 |
From: Jindrich Makovicka <address@hidden>
Signed-off-by: Jindrich Makovicka <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/sdl2.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 8718cf36b5..62a75318dd 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -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();
--
2.9.3
- [Qemu-devel] [PULL 0/9] Ui 20180112 patches, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 3/9] spice: remove QXLWorker interface field, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 4/9] spice: remove unused watch list, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 1/9] input: fix memory leak, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 8/9] sdl2 uses surface relative coordinates, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 5/9] spice: remove only written event_mask field, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 6/9] spice: remove unused timer list, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 2/9] ui: deprecate use of GTK 2.x in favour of 3.x series, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 9/9] sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held, Gerd Hoffmann, 2018/01/12
- [Qemu-devel] [PULL 7/9] sdl2: Do not hide the cursor on auxilliary windows,
Gerd Hoffmann <=
- Re: [Qemu-devel] [PULL 0/9] Ui 20180112 patches, Peter Maydell, 2018/01/15