diff --git a/sdl.c b/sdl.c index 8117aff..201edcf 100644 --- a/sdl.c +++ b/sdl.c @@ -106,7 +106,9 @@ static void sdl_resize(DisplayState *ds) DefaultScreen(info.info.x11.display))); } - real_screen = SDL_SetVideoMode(ds_get_width(ds), ds_get_height(ds), 0, flags); + width = ds_get_width(ds); + height = ds_get_height(ds); + real_screen = SDL_SetVideoMode(width, height, 0, flags); if (!real_screen) { fprintf(stderr, "Could not open SDL display\n"); exit(1); @@ -293,7 +295,8 @@ static void sdl_grab_start(void) { if (guest_cursor) { SDL_SetCursor(guest_sprite); - SDL_WarpMouse(guest_x, guest_y); + if (!kbd_mouse_is_absolute() && !absolute_enabled) + SDL_WarpMouse(guest_x, guest_y); } else sdl_hide_cursor(); @@ -332,8 +335,8 @@ static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state absolute_enabled = 1; } - dx = x * 0x7FFF / (width - 1); - dy = y * 0x7FFF / (height - 1); + dx = x * 0x7FFF / (width - 1); + dy = y * 0x7FFF / (height - 1); } else if (absolute_enabled) { sdl_show_cursor(); absolute_enabled = 0; @@ -564,7 +567,8 @@ static void sdl_mouse_warp(int x, int y, int on) sdl_show_cursor(); if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) { SDL_SetCursor(guest_sprite); - SDL_WarpMouse(x, y); + if (!kbd_mouse_is_absolute() && !absolute_enabled) + SDL_WarpMouse(x, y); } } else if (gui_grab) sdl_hide_cursor(); diff --git a/target-i386/helper_opengl.c b/target-i386/helper_opengl.c index 8eda500..2a8f3cd 100644 --- a/target-i386/helper_opengl.c +++ b/target-i386/helper_opengl.c @@ -478,7 +478,19 @@ static int decode_call_int(CPUState *env, int func_number, int pid, if (unlikely(func_number == _exit_process_func)) last_process_id = 0; - argcpy: + if (!wordsize) { + if (func_number == _init32_func || func_number == _init64_func) { + if (func_number == _init32_func) { + wordsize = 32; + argcpy_target_to_host = memcpy_target32_to_host; + } else { + wordsize = 64; + argcpy_target_to_host = memcpy_target64_to_host; + } + } else + fprintf(stderr, "commands submitted before initialisation done\n"); + } + reset_host_offset(); if (nb_args) { @@ -862,24 +874,12 @@ static int decode_call_int(CPUState *env, int func_number, int pid, if (func_number == _init32_func || func_number == _init64_func) { if (func_number == _init32_func) { - if (!wordsize) { - wordsize = 32; - argcpy_target_to_host = memcpy_target32_to_host; - goto argcpy; - } - if (wordsize != 32) { fprintf(stderr, "clients with different ABIs not supported\n"); exit(-1); } } else { - if (!wordsize) { - wordsize = 64; - argcpy_target_to_host = memcpy_target64_to_host; - goto argcpy; - } - if (wordsize != 64) { fprintf(stderr, "clients with different ABIs not supported\n");