|
@@ -203,7 +203,7 @@ static void sdl_hide_cursor(struct sdl2_console *scon)
|
|
|
SDL_ShowCursor(SDL_DISABLE);
|
|
|
SDL_SetCursor(sdl_cursor_hidden);
|
|
|
|
|
|
- if (!qemu_input_is_absolute()) {
|
|
|
+ if (!qemu_input_is_absolute(scon->dcl.con)) {
|
|
|
SDL_SetRelativeMouseMode(SDL_TRUE);
|
|
|
}
|
|
|
}
|
|
@@ -214,12 +214,12 @@ static void sdl_show_cursor(struct sdl2_console *scon)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (!qemu_input_is_absolute()) {
|
|
|
+ if (!qemu_input_is_absolute(scon->dcl.con)) {
|
|
|
SDL_SetRelativeMouseMode(SDL_FALSE);
|
|
|
}
|
|
|
|
|
|
if (guest_cursor &&
|
|
|
- (gui_grab || qemu_input_is_absolute() || absolute_enabled)) {
|
|
|
+ (gui_grab || qemu_input_is_absolute(scon->dcl.con) || absolute_enabled)) {
|
|
|
SDL_SetCursor(guest_sprite);
|
|
|
} else {
|
|
|
SDL_SetCursor(sdl_cursor_normal);
|
|
@@ -245,7 +245,7 @@ static void sdl_grab_start(struct sdl2_console *scon)
|
|
|
}
|
|
|
if (guest_cursor) {
|
|
|
SDL_SetCursor(guest_sprite);
|
|
|
- if (!qemu_input_is_absolute() && !absolute_enabled) {
|
|
|
+ if (!qemu_input_is_absolute(scon->dcl.con) && !absolute_enabled) {
|
|
|
SDL_WarpMouseInWindow(scon->real_window, guest_x, guest_y);
|
|
|
}
|
|
|
} else {
|
|
@@ -280,7 +280,7 @@ static void absolute_mouse_grab(struct sdl2_console *scon)
|
|
|
|
|
|
static void sdl_mouse_mode_change(Notifier *notify, void *data)
|
|
|
{
|
|
|
- if (qemu_input_is_absolute()) {
|
|
|
+ if (qemu_input_is_absolute(sdl2_console[0].dcl.con)) {
|
|
|
if (!absolute_enabled) {
|
|
|
absolute_enabled = 1;
|
|
|
SDL_SetRelativeMouseMode(SDL_FALSE);
|
|
@@ -311,7 +311,7 @@ static void sdl_send_mouse_event(struct sdl2_console *scon, int dx, int dy,
|
|
|
prev_state = state;
|
|
|
}
|
|
|
|
|
|
- if (qemu_input_is_absolute()) {
|
|
|
+ if (qemu_input_is_absolute(scon->dcl.con)) {
|
|
|
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,
|
|
@@ -497,7 +497,7 @@ static void handle_mousemotion(SDL_Event *ev)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (qemu_input_is_absolute() || absolute_enabled) {
|
|
|
+ if (qemu_input_is_absolute(scon->dcl.con) || absolute_enabled) {
|
|
|
int scr_w, scr_h;
|
|
|
SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h);
|
|
|
max_x = scr_w - 1;
|
|
@@ -513,7 +513,7 @@ static void handle_mousemotion(SDL_Event *ev)
|
|
|
sdl_grab_start(scon);
|
|
|
}
|
|
|
}
|
|
|
- if (gui_grab || qemu_input_is_absolute() || absolute_enabled) {
|
|
|
+ if (gui_grab || qemu_input_is_absolute(scon->dcl.con) || absolute_enabled) {
|
|
|
sdl_send_mouse_event(scon, ev->motion.xrel, ev->motion.yrel,
|
|
|
ev->motion.x, ev->motion.y, ev->motion.state);
|
|
|
}
|
|
@@ -530,7 +530,7 @@ static void handle_mousebutton(SDL_Event *ev)
|
|
|
}
|
|
|
|
|
|
bev = &ev->button;
|
|
|
- if (!gui_grab && !qemu_input_is_absolute()) {
|
|
|
+ if (!gui_grab && !qemu_input_is_absolute(scon->dcl.con)) {
|
|
|
if (ev->type == SDL_MOUSEBUTTONUP && bev->button == SDL_BUTTON_LEFT) {
|
|
|
/* start grabbing all events */
|
|
|
sdl_grab_start(scon);
|
|
@@ -603,7 +603,7 @@ static void handle_windowevent(SDL_Event *ev)
|
|
|
}
|
|
|
/* fall through */
|
|
|
case SDL_WINDOWEVENT_ENTER:
|
|
|
- if (!gui_grab && (qemu_input_is_absolute() || absolute_enabled)) {
|
|
|
+ if (!gui_grab && (qemu_input_is_absolute(scon->dcl.con) || absolute_enabled)) {
|
|
|
absolute_mouse_grab(scon);
|
|
|
}
|
|
|
/* If a new console window opened using a hotkey receives the
|
|
@@ -733,9 +733,9 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl,
|
|
|
if (!guest_cursor) {
|
|
|
sdl_show_cursor(scon);
|
|
|
}
|
|
|
- if (gui_grab || qemu_input_is_absolute() || absolute_enabled) {
|
|
|
+ if (gui_grab || qemu_input_is_absolute(scon->dcl.con) || absolute_enabled) {
|
|
|
SDL_SetCursor(guest_sprite);
|
|
|
- if (!qemu_input_is_absolute() && !absolute_enabled) {
|
|
|
+ if (!qemu_input_is_absolute(scon->dcl.con) && !absolute_enabled) {
|
|
|
SDL_WarpMouseInWindow(scon->real_window, x, y);
|
|
|
}
|
|
|
}
|
|
@@ -773,7 +773,7 @@ static void sdl_mouse_define(DisplayChangeListener *dcl,
|
|
|
return;
|
|
|
}
|
|
|
if (guest_cursor &&
|
|
|
- (gui_grab || qemu_input_is_absolute() || absolute_enabled)) {
|
|
|
+ (gui_grab || qemu_input_is_absolute(dcl->con) || absolute_enabled)) {
|
|
|
SDL_SetCursor(guest_sprite);
|
|
|
}
|
|
|
}
|