X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=sdl.c;h=266fbcc8c55b26d561245822910d1e1c5677a693;hb=176050719287eb73f6ff8610843cbcbbb0ae388b;hp=cddf67243b999dfbc090170f28c92f54e1193504;hpb=413bfb7cfc4e7f886ad35d610056ad8da8deab8a;p=qemu diff --git a/sdl.c b/sdl.c index cddf672..266fbcc 100644 --- a/sdl.c +++ b/sdl.c @@ -62,7 +62,7 @@ static void sdl_update(DisplayState *ds, int x, int y, int w, int h) // printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h); SDL_BlitSurface(guest_screen, &rec, real_screen, &rec); - SDL_Flip(real_screen); + SDL_UpdateRect(real_screen, x, y, w, h); } static void sdl_setdata(DisplayState *ds) @@ -93,7 +93,9 @@ static void sdl_resize(DisplayState *ds) if (gui_noframe) flags |= SDL_NOFRAME; - 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); @@ -276,7 +278,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(); @@ -547,7 +550,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(); @@ -634,8 +638,6 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) } dcl = qemu_mallocz(sizeof(DisplayChangeListener)); - if (!dcl) - exit(1); dcl->dpy_update = sdl_update; dcl->dpy_resize = sdl_resize; dcl->dpy_refresh = sdl_refresh;