flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
if (gui_fullscreen)
flags |= SDL_FULLSCREEN;
+
+ again:
screen = SDL_SetVideoMode(w, h, 0, flags);
if (!screen) {
fprintf(stderr, "Could not open SDL display\n");
exit(1);
}
+ if (!screen->pixels && (flags & SDL_HWSURFACE) && (flags & SDL_FULLSCREEN)) {
+ flags &= ~SDL_HWSURFACE;
+ goto again;
+ }
+
+ if (!screen->pixels) {
+ fprintf(stderr, "Could not open SDL display\n");
+ exit(1);
+ }
ds->data = screen->pixels;
ds->linesize = screen->pitch;
ds->depth = screen->format->BitsPerPixel;
mod_state = (ev->key.keysym.mod & gui_grab_code);
if (!mod_state) {
if (gui_key_modifier_pressed) {
+ gui_key_modifier_pressed = 0;
if (gui_keysym == 0) {
/* exit/enter grab if pressing Ctrl-Alt */
if (!gui_grab)
reset_keys();
break;
}
- gui_key_modifier_pressed = 0;
gui_keysym = 0;
}
}
}
break;
case SDL_ACTIVEEVENT:
- if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 &&
- !gui_fullscreen_initial_grab) {
+ if (gui_grab && ev->active.state == SDL_APPINPUTFOCUS &&
+ !ev->active.gain && !gui_fullscreen_initial_grab) {
sdl_grab_end();
}
break;