[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/8] sdl2 uses surface relative coordinates
From: |
Jindrich Makovicka |
Subject: |
[Qemu-devel] [PATCH 5/8] sdl2 uses surface relative coordinates |
Date: |
Sun, 12 Nov 2017 20:30:29 +0100 |
This patch fixes mouse positioning with -device usb-tablet and fullscreen
or resized window.
Signed-off-by: Jindrich Makovicka <address@hidden>
---
ui/sdl2.c | 28 ++--------------------------
1 file changed, 2 insertions(+), 26 deletions(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 677c22282d..51721d764e 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -276,32 +276,8 @@ static void sdl_send_mouse_event(struct sdl2_console
*scon, int dx, int dy,
}
if (qemu_input_is_absolute()) {
- int scr_w, scr_h;
- int max_w = 0, max_h = 0;
- int off_x = 0, off_y = 0;
- int cur_off_x = 0, cur_off_y = 0;
- int i;
-
- for (i = 0; i < sdl2_num_outputs; i++) {
- struct sdl2_console *thiscon = &sdl2_console[i];
- if (thiscon->real_window && thiscon->surface) {
- SDL_GetWindowSize(thiscon->real_window, &scr_w, &scr_h);
- cur_off_x = thiscon->x;
- cur_off_y = thiscon->y;
- if (scr_w + cur_off_x > max_w) {
- max_w = scr_w + cur_off_x;
- }
- if (scr_h + cur_off_y > max_h) {
- max_h = scr_h + cur_off_y;
- }
- if (i == scon->idx) {
- off_x = cur_off_x;
- off_y = cur_off_y;
- }
- }
- }
- qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, off_x + x, 0, max_w);
- qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, off_y + y, 0, max_h);
+ qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, x, 0,
surface_width(scon->surface));
+ qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, y, 0,
surface_height(scon->surface));
} else {
if (guest_cursor) {
x -= guest_x;
--
2.15.0
- [Qemu-devel] [PATCH 6/8] sdl2: Fix dead keyboard after fullsceen, (continued)
- [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
- [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Jindrich Makovicka, 2017/11/12
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Gerd Hoffmann, 2017/11/13
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Gerd Hoffmann, 2017/11/13
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Jindřich Makovička, 2017/11/13
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Gerd Hoffmann, 2017/11/13
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Max Reitz, 2017/11/13
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Gerd Hoffmann, 2017/11/14
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Max Reitz, 2017/11/14
- Re: [Qemu-devel] [PATCH 1/8] sdl2: Fix broken display updating after the window is hidden, Gerd Hoffmann, 2017/11/14