mirror of https://github.com/xemu-project/xemu.git
ui/xemu: Pass scon->dcl.con to new required args
This commit is contained in:
parent
031283eca4
commit
46e8cf16ee
26
ui/xemu.c
26
ui/xemu.c
|
@ -252,7 +252,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);
|
||||
}
|
||||
}
|
||||
|
@ -263,12 +263,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);
|
||||
|
@ -295,7 +295,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 {
|
||||
|
@ -329,7 +329,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);
|
||||
|
@ -358,7 +358,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,
|
||||
|
@ -511,7 +511,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;
|
||||
|
@ -527,7 +527,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);
|
||||
}
|
||||
|
@ -544,7 +544,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);
|
||||
|
@ -613,7 +613,7 @@ static void handle_windowevent(SDL_Event *ev)
|
|||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
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
|
||||
|
@ -736,9 +736,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);
|
||||
}
|
||||
}
|
||||
|
@ -776,7 +776,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue