Skip to contentSkip to conversation

ioemu: Fix non-openGL resize

PATCH New Samuel Thibault 1 participant 1 message Mar 19, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioemu: Fix non-openGL resize

ioemu: Fix non-openGL resize
We can not resize when OpenGL is not enabled.

tools/ioemu/sdl.c +6 -4
diff -r b4f6d626c41f tools/ioemu/sdl.c
@@ -664,10 +664,12 @@ static void sdl_refresh(DisplayState *ds
 #ifdef CONFIG_OPENGL
         case SDL_VIDEORESIZE:
         {
-            SDL_ResizeEvent *rev = &ev->resize;
-            screen = SDL_SetVideoMode(rev->w, rev->h, 0, SDL_OPENGL|SDL_RESIZABLE);
-            opengl_setdata(ds, ds->data);
-            opengl_update(ds, 0, 0, ds->width, ds->height);
+            if (ds->shared_buf && opengl_enabled) {
+                SDL_ResizeEvent *rev = &ev->resize;
+                screen = SDL_SetVideoMode(rev->w, rev->h, 0, SDL_OPENGL|SDL_RESIZABLE);
+                opengl_setdata(ds, ds->data);
+                opengl_update(ds, 0, 0, ds->width, ds->height);
+            }
             break;
         }
 #endif