src/video/directfb/SDL_DirectFB_window.c
author Couriersud
Tue, 13 Jan 2009 21:17:38 +0000
changeset 3037 490f3e4fe753
parent 3023 d72a0dd80e8b
child 3038 c73a5f8a03d2
permissions -rw-r--r--
Added DFB_VERSION_ATLEAST macro
First attempt at replacing MakeSubSurface for pre 1.2.0 ==> Scaling not yet working
slouken@2737
     1
/*
slouken@2737
     2
    SDL - Simple DirectMedia Layer
slouken@2859
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@2737
     4
slouken@2737
     5
    This library is free software; you can redistribute it and/or
slouken@2737
     6
    modify it under the terms of the GNU Lesser General Public
slouken@2737
     7
    License as published by the Free Software Foundation; either
slouken@2737
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@2737
     9
slouken@2737
    10
    This library is distributed in the hope that it will be useful,
slouken@2737
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@2737
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@2737
    13
    Lesser General Public License for more details.
slouken@2737
    14
slouken@2737
    15
    You should have received a copy of the GNU Lesser General Public
slouken@2737
    16
    License along with this library; if not, write to the Free Software
slouken@2737
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@2737
    18
slouken@2737
    19
    Sam Lantinga
slouken@2737
    20
    slouken@libsdl.org
slouken@2737
    21
*/
slouken@2737
    22
#include "SDL_config.h"
slouken@2737
    23
slouken@2737
    24
#include "SDL_syswm.h"
slouken@2737
    25
#include "../SDL_sysvideo.h"
slouken@2737
    26
#include "../../events/SDL_keyboard_c.h"
slouken@2737
    27
slouken@2737
    28
#include "SDL_DirectFB_video.h"
slouken@2737
    29
couriersud@3023
    30
slouken@2737
    31
int
slouken@2737
    32
DirectFB_CreateWindow(_THIS, SDL_Window * window)
slouken@2737
    33
{
slouken@2737
    34
    SDL_DFB_DEVICEDATA(_this);
slouken@2737
    35
    SDL_DFB_DISPLAYDATA(_this, window);
couriersud@3023
    36
    DFB_WindowData *windata = NULL;
slouken@2737
    37
    DFBWindowOptions wopts;
slouken@2737
    38
    DFBWindowDescription desc;
couriersud@3023
    39
    IDirectFBFont *font;
slouken@2737
    40
    int ret, x, y;
slouken@2737
    41
slouken@2737
    42
    SDL_DFB_CALLOC(window->driverdata, 1, sizeof(DFB_WindowData));
slouken@2737
    43
    windata = (DFB_WindowData *) window->driverdata;
slouken@2737
    44
couriersud@3023
    45
    windata->is_managed = devdata->has_own_wm;
couriersud@3023
    46
couriersud@3023
    47
    SDL_DFB_CHECKERR(devdata->dfb->SetCooperativeLevel(devdata->dfb,
couriersud@3023
    48
                                                       DFSCL_NORMAL));
couriersud@3023
    49
    SDL_DFB_CHECKERR(dispdata->layer->SetCooperativeLevel(dispdata->layer,
couriersud@3023
    50
                                                          DLSCL_ADMINISTRATIVE));
slouken@2737
    51
slouken@2737
    52
    /* Fill the window description. */
slouken@2737
    53
    if (window->x == SDL_WINDOWPOS_CENTERED) {
slouken@2737
    54
        x = (dispdata->cw - window->w) / 2;
slouken@2737
    55
    } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
slouken@2737
    56
        x = 0;
slouken@2737
    57
    } else {
slouken@2737
    58
        x = window->x;
slouken@2737
    59
    }
slouken@2737
    60
    if (window->y == SDL_WINDOWPOS_CENTERED) {
slouken@2737
    61
        y = (dispdata->ch - window->h) / 2;
slouken@2737
    62
    } else if (window->y == SDL_WINDOWPOS_UNDEFINED) {
slouken@2737
    63
        y = 0;
slouken@2737
    64
    } else {
slouken@2737
    65
        y = window->y;
slouken@2737
    66
    }
slouken@2737
    67
    if (window->flags & SDL_WINDOW_FULLSCREEN) {
slouken@2737
    68
        x = 0;
slouken@2737
    69
        y = 0;
slouken@2737
    70
    }
slouken@2737
    71
couriersud@3023
    72
    DirectFB_WM_AdjustWindowLayout(window);
slouken@2737
    73
couriersud@3023
    74
    /* Create Window */
couriersud@3023
    75
    desc.flags =
couriersud@3023
    76
        DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT | DWDESC_POSX
couriersud@3023
    77
        | DWDESC_POSY | DWDESC_SURFACE_CAPS;
slouken@2737
    78
    desc.posx = x;
slouken@2737
    79
    desc.posy = y;
couriersud@3023
    80
    desc.width = windata->size.w;
couriersud@3023
    81
    desc.height = windata->size.h;
slouken@2737
    82
    desc.pixelformat = dispdata->pixelformat;
slouken@2737
    83
    desc.surface_caps = DSCAPS_PREMULTIPLIED;
slouken@2737
    84
slouken@2737
    85
    /* Create the window. */
couriersud@3023
    86
    SDL_DFB_CHECKERR(dispdata->layer->CreateWindow(dispdata->layer, &desc,
couriersud@3023
    87
                                                   &windata->window));
slouken@2737
    88
couriersud@3023
    89
    /* Set Options */
slouken@2737
    90
    windata->window->GetOptions(windata->window, &wopts);
slouken@2737
    91
slouken@2737
    92
    if (window->flags & SDL_WINDOW_RESIZABLE)
slouken@2737
    93
        wopts |= DWOP_SCALE;
slouken@2737
    94
    else
slouken@2737
    95
        wopts |= DWOP_KEEP_SIZE;
slouken@2737
    96
couriersud@3023
    97
    if (window->flags & SDL_WINDOW_FULLSCREEN) {
slouken@2737
    98
        wopts |= DWOP_KEEP_POSITION | DWOP_KEEP_STACKING | DWOP_KEEP_SIZE;
couriersud@3023
    99
        windata->window->SetStackingClass(windata->window, DWSC_UPPER);
couriersud@3023
   100
    }
couriersud@3023
   101
    windata->window->SetOptions(windata->window, wopts);
slouken@2737
   102
couriersud@3023
   103
    /* See what we got */
couriersud@3023
   104
    SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
couriersud@3023
   105
slouken@2737
   106
    /* Get the window's surface. */
couriersud@3023
   107
    SDL_DFB_CHECKERR(windata->window->GetSurface(windata->window,
couriersud@3023
   108
                                                 &windata->window_surface));
couriersud@3023
   109
    /* And get a subsurface for rendering */
couriersud@3023
   110
    SDL_DFB_CHECKERR(windata->window_surface->
couriersud@3023
   111
                     GetSubSurface(windata->window_surface, &windata->client,
couriersud@3023
   112
                                   &windata->surface));
couriersud@3023
   113
slouken@2737
   114
    windata->window->SetOpacity(windata->window, 0xFF);
couriersud@3023
   115
couriersud@3023
   116
    /* Create Eventbuffer */
couriersud@3023
   117
    SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
couriersud@3023
   118
                                                        &windata->eventbuffer));
couriersud@3023
   119
    SDL_DFB_CHECKERR(windata->
couriersud@3023
   120
                     window->EnableEvents(windata->window, DWET_ALL));
slouken@2737
   121
couriersud@3023
   122
    /* Create a font */
couriersud@3023
   123
    /* FIXME: once during Video_Init */
couriersud@3023
   124
    if (windata->is_managed) {
couriersud@3023
   125
        DFBFontDescription fdesc;
couriersud@3023
   126
couriersud@3023
   127
        fdesc.flags = DFDESC_HEIGHT;
couriersud@3023
   128
        fdesc.height = windata->theme.font_size;
couriersud@3023
   129
        font = NULL;
couriersud@3023
   130
        SDL_DFB_CHECK(devdata->
couriersud@3023
   131
                      dfb->CreateFont(devdata->dfb, windata->theme.font,
couriersud@3023
   132
                                      &fdesc, &font));
couriersud@3023
   133
        windata->window_surface->SetFont(windata->window_surface, font);
couriersud@3023
   134
        SDL_DFB_RELEASE(font);
couriersud@3023
   135
    }
couriersud@3023
   136
slouken@2737
   137
    /* Make it the top most window. */
slouken@2737
   138
    windata->window->RaiseToTop(windata->window);
slouken@2737
   139
slouken@2737
   140
    /* remember parent */
couriersud@3023
   141
    windata->sdl_id = window->id;
slouken@2737
   142
slouken@2737
   143
    /* Add to list ... */
slouken@2737
   144
slouken@2737
   145
    windata->next = devdata->firstwin;
slouken@2737
   146
    windata->opacity = 0xFF;
slouken@2737
   147
    devdata->firstwin = windata;
slouken@2737
   148
couriersud@3023
   149
    /* Draw Frame */
couriersud@3023
   150
    DirectFB_WM_RedrawLayout(window);
couriersud@3023
   151
slouken@2737
   152
    return 0;
slouken@2737
   153
  error:
slouken@2737
   154
    SDL_DFB_RELEASE(windata->window);
slouken@2737
   155
    SDL_DFB_RELEASE(windata->surface);
slouken@2737
   156
    return -1;
slouken@2737
   157
}
slouken@2737
   158
slouken@2737
   159
int
slouken@2737
   160
DirectFB_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
slouken@2737
   161
{
slouken@2737
   162
    SDL_Unsupported();
slouken@2737
   163
    return -1;
slouken@2737
   164
}
slouken@2737
   165
slouken@2737
   166
void
slouken@2737
   167
DirectFB_SetWindowTitle(_THIS, SDL_Window * window)
slouken@2737
   168
{
couriersud@3023
   169
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   170
couriersud@3023
   171
    if (windata->is_managed) {
couriersud@3023
   172
        windata->wm_needs_redraw = 1;
couriersud@3023
   173
    } else
couriersud@3023
   174
        SDL_Unsupported();
couriersud@3023
   175
}
couriersud@3023
   176
couriersud@3023
   177
void
couriersud@3023
   178
DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
couriersud@3023
   179
{
couriersud@3023
   180
    SDL_DFB_DEVICEDATA(_this);
couriersud@3023
   181
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   182
    SDL_Surface *surface = NULL;
couriersud@3023
   183
    DFBResult ret;
couriersud@3023
   184
couriersud@3023
   185
    if (icon) {
couriersud@3023
   186
        SDL_PixelFormat format;
couriersud@3023
   187
        DFBSurfaceDescription dsc;
couriersud@3023
   188
        Uint32 *dest;
couriersud@3023
   189
        Uint32 *p;
couriersud@3023
   190
        int pitch, i;
couriersud@3023
   191
couriersud@3023
   192
        /* Convert the icon to ARGB for modern window managers */
couriersud@3023
   193
        SDL_InitFormat(&format, 32, 0x00FF0000, 0x0000FF00, 0x000000FF,
couriersud@3023
   194
                       0xFF000000);
couriersud@3023
   195
        surface = SDL_ConvertSurface(icon, &format, 0);
couriersud@3023
   196
        if (!surface) {
couriersud@3023
   197
            return;
couriersud@3023
   198
        }
couriersud@3023
   199
        dsc.flags =
couriersud@3023
   200
            DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
couriersud@3023
   201
        dsc.caps = DSCAPS_VIDEOONLY;
couriersud@3023
   202
        dsc.width = surface->w;
couriersud@3023
   203
        dsc.height = surface->h;
couriersud@3023
   204
        dsc.pixelformat = DSPF_ARGB;
couriersud@3023
   205
couriersud@3023
   206
        SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
couriersud@3023
   207
                                                     &windata->icon));
couriersud@3023
   208
couriersud@3023
   209
        SDL_DFB_CHECKERR(windata->icon->Lock(windata->icon, DSLF_WRITE,
couriersud@3023
   210
                                             (void *) &dest, &pitch));
couriersud@3023
   211
couriersud@3023
   212
        p = surface->pixels;
couriersud@3023
   213
        for (i = 0; i < surface->h; i++)
couriersud@3023
   214
            memcpy((char *) dest + i * pitch,
couriersud@3023
   215
                   (char *) p + i * surface->pitch, 4 * surface->w);
couriersud@3023
   216
couriersud@3023
   217
        windata->icon->Unlock(windata->icon);
couriersud@3023
   218
        SDL_FreeSurface(surface);
couriersud@3023
   219
    } else {
couriersud@3023
   220
        SDL_DFB_RELEASE(windata->icon);
couriersud@3023
   221
    }
couriersud@3023
   222
    return;
couriersud@3023
   223
  error:
couriersud@3023
   224
    if (surface)
couriersud@3023
   225
        SDL_FreeSurface(surface);
couriersud@3023
   226
    SDL_DFB_RELEASE(windata->icon);
couriersud@3023
   227
    return;
slouken@2737
   228
}
slouken@2737
   229
slouken@2737
   230
void
slouken@2737
   231
DirectFB_SetWindowPosition(_THIS, SDL_Window * window)
slouken@2737
   232
{
slouken@2737
   233
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   234
    int x, y;
slouken@2737
   235
slouken@2737
   236
    if (window->y == SDL_WINDOWPOS_UNDEFINED)
slouken@2737
   237
        y = 0;
slouken@2737
   238
    else
slouken@2737
   239
        y = window->y;
slouken@2737
   240
slouken@2737
   241
    if (window->x == SDL_WINDOWPOS_UNDEFINED)
slouken@2737
   242
        x = 0;
slouken@2737
   243
    else
slouken@2737
   244
        x = window->x;
slouken@2737
   245
slouken@2737
   246
    if (window->flags & SDL_WINDOW_FULLSCREEN) {
slouken@2737
   247
        x = 0;
slouken@2737
   248
        y = 0;
slouken@2737
   249
    }
couriersud@3023
   250
    DirectFB_WM_AdjustWindowLayout(window);
slouken@2737
   251
    windata->window->MoveTo(windata->window, x, y);
slouken@2737
   252
}
slouken@2737
   253
slouken@2737
   254
void
slouken@2737
   255
DirectFB_SetWindowSize(_THIS, SDL_Window * window)
slouken@2737
   256
{
couriersud@3023
   257
    SDL_DFB_DEVICEDATA(_this);
couriersud@3023
   258
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   259
    int ret;
slouken@2737
   260
slouken@2737
   261
    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
slouken@2737
   262
        int cw;
slouken@2737
   263
        int ch;
slouken@2737
   264
slouken@2737
   265
        /* Make sure all events are disabled for this operation ! */
couriersud@3023
   266
        SDL_DFB_CHECKERR(windata->window->DisableEvents(windata->window,
couriersud@3023
   267
                                                        DWET_ALL));
couriersud@3023
   268
couriersud@3023
   269
        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &cw, &ch));
couriersud@3023
   270
couriersud@3023
   271
        if (cw != window->w || ch != window->h) {
slouken@2737
   272
couriersud@3023
   273
            DirectFB_WM_AdjustWindowLayout(window);
couriersud@3023
   274
            SDL_DFB_CHECKERR(windata->window->Resize(windata->window,
couriersud@3023
   275
                                                     windata->size.w,
couriersud@3023
   276
                                                     windata->size.h));
couriersud@3023
   277
        }
slouken@2737
   278
couriersud@3023
   279
        SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window,
couriersud@3023
   280
                                                       DWET_ALL));
couriersud@3023
   281
couriersud@3023
   282
        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &window->w, &window->h));
slouken@2737
   283
slouken@2737
   284
        SDL_OnWindowResized(window);
slouken@2737
   285
    }
slouken@2737
   286
    return;
slouken@2737
   287
  error:
slouken@2737
   288
    windata->window->EnableEvents(windata->window, DWET_ALL);
slouken@2737
   289
    return;
slouken@2737
   290
}
slouken@2737
   291
slouken@2737
   292
void
slouken@2737
   293
DirectFB_ShowWindow(_THIS, SDL_Window * window)
slouken@2737
   294
{
slouken@2737
   295
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   296
slouken@2737
   297
    windata->window->SetOpacity(windata->window, windata->opacity);
slouken@2737
   298
slouken@2737
   299
}
slouken@2737
   300
slouken@2737
   301
void
slouken@2737
   302
DirectFB_HideWindow(_THIS, SDL_Window * window)
slouken@2737
   303
{
slouken@2737
   304
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   305
slouken@2737
   306
    windata->window->GetOpacity(windata->window, &windata->opacity);
slouken@2737
   307
    windata->window->SetOpacity(windata->window, 0);
slouken@2737
   308
}
slouken@2737
   309
slouken@2737
   310
void
slouken@2737
   311
DirectFB_RaiseWindow(_THIS, SDL_Window * window)
slouken@2737
   312
{
slouken@2737
   313
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   314
slouken@2737
   315
    windata->window->RaiseToTop(windata->window);
slouken@2737
   316
    windata->window->RequestFocus(windata->window);
slouken@2737
   317
}
slouken@2737
   318
slouken@2737
   319
void
slouken@2737
   320
DirectFB_MaximizeWindow(_THIS, SDL_Window * window)
slouken@2737
   321
{
couriersud@3023
   322
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   323
couriersud@3023
   324
    if (windata->is_managed) {
couriersud@3023
   325
    	DirectFB_WM_MaximizeWindow(_this, window);
couriersud@3023
   326
    } else
couriersud@3023
   327
        SDL_Unsupported();
slouken@2737
   328
}
slouken@2737
   329
slouken@2737
   330
void
slouken@2737
   331
DirectFB_MinimizeWindow(_THIS, SDL_Window * window)
slouken@2737
   332
{
slouken@2737
   333
    /* FIXME: Size to 32x32 ? */
slouken@2737
   334
slouken@2737
   335
    SDL_Unsupported();
slouken@2737
   336
}
slouken@2737
   337
slouken@2737
   338
void
slouken@2737
   339
DirectFB_RestoreWindow(_THIS, SDL_Window * window)
slouken@2737
   340
{
couriersud@3023
   341
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   342
couriersud@3023
   343
    if (windata->is_managed) {
couriersud@3023
   344
    	DirectFB_WM_RestoreWindow(_this, window);
couriersud@3023
   345
    } else
couriersud@3023
   346
        SDL_Unsupported();
slouken@2737
   347
}
slouken@2737
   348
slouken@2737
   349
void
slouken@2737
   350
DirectFB_SetWindowGrab(_THIS, SDL_Window * window)
slouken@2737
   351
{
slouken@2737
   352
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   353
couriersud@3023
   354
    if ((window->flags & SDL_WINDOW_INPUT_GRABBED)) {
slouken@2737
   355
        windata->window->GrabPointer(windata->window);
slouken@2737
   356
        windata->window->GrabKeyboard(windata->window);
slouken@2737
   357
    } else {
slouken@2737
   358
        windata->window->UngrabPointer(windata->window);
slouken@2737
   359
        windata->window->UngrabKeyboard(windata->window);
slouken@2737
   360
    }
slouken@2737
   361
}
slouken@2737
   362
slouken@2737
   363
void
slouken@2737
   364
DirectFB_DestroyWindow(_THIS, SDL_Window * window)
slouken@2737
   365
{
slouken@2737
   366
    SDL_DFB_DEVICEDATA(_this);
slouken@2737
   367
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   368
    DFB_WindowData *p;
slouken@2737
   369
slouken@2737
   370
    SDL_DFB_DEBUG("Trace\n");
slouken@2737
   371
couriersud@3023
   372
    /* Some cleanups */
couriersud@3023
   373
    windata->window->UngrabPointer(windata->window);
couriersud@3023
   374
    windata->window->UngrabKeyboard(windata->window);
couriersud@3023
   375
couriersud@3023
   376
    windata->window_surface->SetFont(windata->window_surface, NULL);
couriersud@3023
   377
    SDL_DFB_RELEASE(windata->icon);
slouken@2737
   378
    SDL_DFB_RELEASE(windata->eventbuffer);
slouken@2737
   379
    SDL_DFB_RELEASE(windata->surface);
couriersud@3023
   380
    SDL_DFB_RELEASE(windata->window_surface);
couriersud@3023
   381
slouken@2737
   382
    SDL_DFB_RELEASE(windata->window);
slouken@2737
   383
slouken@2737
   384
    /* Remove from list ... */
slouken@2737
   385
slouken@2737
   386
    p = devdata->firstwin;
slouken@2737
   387
    while (p && p->next != windata)
slouken@2737
   388
        p = p->next;
slouken@2737
   389
    if (p)
slouken@2737
   390
        p->next = windata->next;
slouken@2737
   391
    else
slouken@2737
   392
        devdata->firstwin = windata->next;
slouken@2737
   393
    SDL_free(windata);
slouken@2737
   394
    return;
slouken@2737
   395
}
slouken@2737
   396
slouken@2737
   397
SDL_bool
slouken@2737
   398
DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window,
slouken@2737
   399
                         struct SDL_SysWMinfo * info)
slouken@2737
   400
{
slouken@2737
   401
    SDL_Unsupported();
slouken@2737
   402
    return SDL_FALSE;
slouken@2737
   403
}
couriersud@3023
   404
couriersud@3023
   405
void
couriersud@3023
   406
DirectFB_AdjustWindowSurface(SDL_Window * window)
couriersud@3023
   407
{
couriersud@3023
   408
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   409
    int adjust = windata->wm_needs_redraw;
couriersud@3023
   410
    int cw, ch;
couriersud@3023
   411
    int ret;
couriersud@3023
   412
couriersud@3023
   413
    DirectFB_WM_AdjustWindowLayout(window);
couriersud@3023
   414
couriersud@3023
   415
    SDL_DFB_CHECKERR(windata->
couriersud@3023
   416
                     window_surface->GetSize(windata->window_surface, &cw,
couriersud@3023
   417
                                             &ch));
couriersud@3023
   418
    if (cw != windata->size.w || ch != windata->size.h) {
couriersud@3023
   419
        adjust = 1;
couriersud@3023
   420
    }
couriersud@3023
   421
couriersud@3023
   422
    if (adjust) {
couriersud@3037
   423
#if DFB_VERSION_ATLEAST(1,2,0)
couriersud@3037
   424
       SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
couriersud@3023
   425
                                                        windata->size.w,
couriersud@3023
   426
                                                        windata->size.h));
couriersud@3037
   427
       SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
couriersud@3023
   428
                                                          windata->
couriersud@3023
   429
                                                          window_surface,
couriersud@3023
   430
                                                          &windata->client));
couriersud@3037
   431
#else
couriersud@3037
   432
       /* recreate subsurface */
couriersud@3037
   433
       windata->surface->ReleaseSource(windata->surface);
couriersud@3037
   434
       windata->window_surface->ReleaseSource(windata->window_surface);
couriersud@3037
   435
       SDL_DFB_RELEASE(windata->surface);
couriersud@3037
   436
       windata->surface = NULL;
couriersud@3037
   437
       SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
couriersud@3037
   438
                                                       windata->size.w,
couriersud@3037
   439
                                                       windata->size.h));
couriersud@3037
   440
       SDL_DFB_CHECKERR(windata->window_surface->
couriersud@3037
   441
                        GetSubSurface(windata->window_surface, &windata->client,
couriersud@3037
   442
                                      &windata->surface));
couriersud@3037
   443
#endif
couriersud@3037
   444
       DirectFB_WM_RedrawLayout(window);
couriersud@3023
   445
    }
couriersud@3023
   446
  error:
couriersud@3023
   447
    return;
couriersud@3023
   448
}
couriersud@3023
   449