[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/8] sdl2: Do not hide the cursor on auxilliary wind
From: |
Jindrich Makovicka |
Subject: |
[Qemu-devel] [PATCH 4/8] sdl2: Do not hide the cursor on auxilliary windows |
Date: |
Sun, 12 Nov 2017 11:42:42 +0100 |
---
ui/sdl2.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 9cf4b1772b..677c22282d 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -465,6 +465,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);
@@ -492,6 +496,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) {
@@ -514,6 +522,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) {
@@ -655,6 +667,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.15.0
- [Qemu-devel] [PATCH] SDL2 various fixes, Jindrich Makovicka, 2017/11/12
- [Qemu-devel] [PATCH 2/8] sdl2: Do not quit the emulator when an auxilliary window is closed, Jindrich Makovicka, 2017/11/12
- [Qemu-devel] [PATCH 3/8] sdl2: Use the same pointer show/hide logic for absolute and relative mode, Jindrich Makovicka, 2017/11/12
- [Qemu-devel] [PATCH 4/8] sdl2: Do not hide the cursor on auxilliary windows,
Jindrich Makovicka <=
- [Qemu-devel] [PATCH 6/8] sdl2: Fix dead keyboard after fullsceen, Jindrich Makovicka, 2017/11/12
- [Qemu-devel] [PATCH 5/8] sdl2 uses surface relative coordinates, Jindrich Makovicka, 2017/11/12
- [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Jindrich Makovicka, 2017/11/12
- [Qemu-devel] [PATCH 7/8] sdl2: Do not leave grab when fullscreen, Jindrich Makovicka, 2017/11/12
- [Qemu-devel] [PATCH 8/8] sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held, Jindrich Makovicka, 2017/11/12
- Re: [Qemu-devel] [PATCH] SDL2 various fixes, Philippe Mathieu-Daudé, 2017/11/12