src/video/directfb/SDL_DirectFB_window.c
changeset 3037 490f3e4fe753
parent 3023 d72a0dd80e8b
child 3038 c73a5f8a03d2
     1.1 --- a/src/video/directfb/SDL_DirectFB_window.c	Tue Jan 13 19:31:06 2009 +0000
     1.2 +++ b/src/video/directfb/SDL_DirectFB_window.c	Tue Jan 13 21:17:38 2009 +0000
     1.3 @@ -420,14 +420,28 @@
     1.4      }
     1.5  
     1.6      if (adjust) {
     1.7 -        SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
     1.8 +#if DFB_VERSION_ATLEAST(1,2,0)
     1.9 +       SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
    1.10                                                          windata->size.w,
    1.11                                                          windata->size.h));
    1.12 -        SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
    1.13 +       SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
    1.14                                                            windata->
    1.15                                                            window_surface,
    1.16                                                            &windata->client));
    1.17 -        DirectFB_WM_RedrawLayout(window);
    1.18 +#else
    1.19 +       /* recreate subsurface */
    1.20 +       windata->surface->ReleaseSource(windata->surface);
    1.21 +       windata->window_surface->ReleaseSource(windata->window_surface);
    1.22 +       SDL_DFB_RELEASE(windata->surface);
    1.23 +       windata->surface = NULL;
    1.24 +       SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
    1.25 +                                                       windata->size.w,
    1.26 +                                                       windata->size.h));
    1.27 +       SDL_DFB_CHECKERR(windata->window_surface->
    1.28 +                        GetSubSurface(windata->window_surface, &windata->client,
    1.29 +                                      &windata->surface));
    1.30 +#endif
    1.31 +       DirectFB_WM_RedrawLayout(window);
    1.32      }
    1.33    error:
    1.34      return;