src/video/directfb/SDL_DirectFB_window.c
author Sam Lantinga
Thu, 21 Jan 2010 06:21:52 +0000
changeset 3685 64ce267332c6
parent 3040 62d4992e5a92
child 3697 f7b03b6838cb
permissions -rw-r--r--
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
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 */
slouken@3040
   104
    SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
slouken@3040
   105
                     (_this, window, &window->w, &window->h));
couriersud@3023
   106
slouken@2737
   107
    /* Get the window's surface. */
couriersud@3023
   108
    SDL_DFB_CHECKERR(windata->window->GetSurface(windata->window,
couriersud@3023
   109
                                                 &windata->window_surface));
couriersud@3023
   110
    /* And get a subsurface for rendering */
couriersud@3023
   111
    SDL_DFB_CHECKERR(windata->window_surface->
couriersud@3023
   112
                     GetSubSurface(windata->window_surface, &windata->client,
couriersud@3023
   113
                                   &windata->surface));
couriersud@3023
   114
slouken@2737
   115
    windata->window->SetOpacity(windata->window, 0xFF);
couriersud@3023
   116
couriersud@3023
   117
    /* Create Eventbuffer */
couriersud@3023
   118
    SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window,
slouken@3040
   119
                                                        &windata->
slouken@3040
   120
                                                        eventbuffer));
slouken@3040
   121
    SDL_DFB_CHECKERR(windata->window->
slouken@3040
   122
                     EnableEvents(windata->window, DWET_ALL));
slouken@2737
   123
couriersud@3023
   124
    /* Create a font */
couriersud@3023
   125
    /* FIXME: once during Video_Init */
couriersud@3023
   126
    if (windata->is_managed) {
couriersud@3023
   127
        DFBFontDescription fdesc;
couriersud@3023
   128
couriersud@3023
   129
        fdesc.flags = DFDESC_HEIGHT;
couriersud@3023
   130
        fdesc.height = windata->theme.font_size;
couriersud@3023
   131
        font = NULL;
couriersud@3023
   132
        SDL_DFB_CHECK(devdata->
couriersud@3023
   133
                      dfb->CreateFont(devdata->dfb, windata->theme.font,
couriersud@3023
   134
                                      &fdesc, &font));
couriersud@3023
   135
        windata->window_surface->SetFont(windata->window_surface, font);
couriersud@3023
   136
        SDL_DFB_RELEASE(font);
couriersud@3023
   137
    }
couriersud@3023
   138
slouken@2737
   139
    /* Make it the top most window. */
slouken@2737
   140
    windata->window->RaiseToTop(windata->window);
slouken@2737
   141
slouken@2737
   142
    /* remember parent */
slouken@3685
   143
    windata->window = window;
slouken@2737
   144
slouken@2737
   145
    /* Add to list ... */
slouken@2737
   146
slouken@2737
   147
    windata->next = devdata->firstwin;
slouken@2737
   148
    windata->opacity = 0xFF;
slouken@2737
   149
    devdata->firstwin = windata;
slouken@2737
   150
couriersud@3023
   151
    /* Draw Frame */
couriersud@3023
   152
    DirectFB_WM_RedrawLayout(window);
couriersud@3023
   153
slouken@2737
   154
    return 0;
slouken@2737
   155
  error:
slouken@2737
   156
    SDL_DFB_RELEASE(windata->window);
slouken@2737
   157
    SDL_DFB_RELEASE(windata->surface);
slouken@2737
   158
    return -1;
slouken@2737
   159
}
slouken@2737
   160
slouken@2737
   161
int
slouken@2737
   162
DirectFB_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
slouken@2737
   163
{
slouken@2737
   164
    SDL_Unsupported();
slouken@2737
   165
    return -1;
slouken@2737
   166
}
slouken@2737
   167
slouken@2737
   168
void
slouken@2737
   169
DirectFB_SetWindowTitle(_THIS, SDL_Window * window)
slouken@2737
   170
{
couriersud@3023
   171
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   172
couriersud@3023
   173
    if (windata->is_managed) {
couriersud@3023
   174
        windata->wm_needs_redraw = 1;
couriersud@3023
   175
    } else
couriersud@3023
   176
        SDL_Unsupported();
couriersud@3023
   177
}
couriersud@3023
   178
couriersud@3023
   179
void
couriersud@3023
   180
DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
couriersud@3023
   181
{
couriersud@3023
   182
    SDL_DFB_DEVICEDATA(_this);
couriersud@3023
   183
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   184
    SDL_Surface *surface = NULL;
couriersud@3023
   185
    DFBResult ret;
couriersud@3023
   186
couriersud@3023
   187
    if (icon) {
couriersud@3023
   188
        SDL_PixelFormat format;
couriersud@3023
   189
        DFBSurfaceDescription dsc;
couriersud@3023
   190
        Uint32 *dest;
couriersud@3023
   191
        Uint32 *p;
couriersud@3023
   192
        int pitch, i;
couriersud@3023
   193
couriersud@3023
   194
        /* Convert the icon to ARGB for modern window managers */
couriersud@3023
   195
        SDL_InitFormat(&format, 32, 0x00FF0000, 0x0000FF00, 0x000000FF,
couriersud@3023
   196
                       0xFF000000);
couriersud@3023
   197
        surface = SDL_ConvertSurface(icon, &format, 0);
couriersud@3023
   198
        if (!surface) {
couriersud@3023
   199
            return;
couriersud@3023
   200
        }
couriersud@3023
   201
        dsc.flags =
couriersud@3023
   202
            DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
couriersud@3023
   203
        dsc.caps = DSCAPS_VIDEOONLY;
couriersud@3023
   204
        dsc.width = surface->w;
couriersud@3023
   205
        dsc.height = surface->h;
couriersud@3023
   206
        dsc.pixelformat = DSPF_ARGB;
couriersud@3023
   207
couriersud@3023
   208
        SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
couriersud@3023
   209
                                                     &windata->icon));
couriersud@3023
   210
couriersud@3023
   211
        SDL_DFB_CHECKERR(windata->icon->Lock(windata->icon, DSLF_WRITE,
couriersud@3023
   212
                                             (void *) &dest, &pitch));
couriersud@3023
   213
couriersud@3023
   214
        p = surface->pixels;
couriersud@3023
   215
        for (i = 0; i < surface->h; i++)
couriersud@3023
   216
            memcpy((char *) dest + i * pitch,
couriersud@3023
   217
                   (char *) p + i * surface->pitch, 4 * surface->w);
couriersud@3023
   218
couriersud@3023
   219
        windata->icon->Unlock(windata->icon);
couriersud@3023
   220
        SDL_FreeSurface(surface);
couriersud@3023
   221
    } else {
couriersud@3023
   222
        SDL_DFB_RELEASE(windata->icon);
couriersud@3023
   223
    }
couriersud@3023
   224
    return;
couriersud@3023
   225
  error:
couriersud@3023
   226
    if (surface)
couriersud@3023
   227
        SDL_FreeSurface(surface);
couriersud@3023
   228
    SDL_DFB_RELEASE(windata->icon);
couriersud@3023
   229
    return;
slouken@2737
   230
}
slouken@2737
   231
slouken@2737
   232
void
slouken@2737
   233
DirectFB_SetWindowPosition(_THIS, SDL_Window * window)
slouken@2737
   234
{
slouken@2737
   235
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   236
    int x, y;
slouken@2737
   237
slouken@2737
   238
    if (window->y == SDL_WINDOWPOS_UNDEFINED)
slouken@2737
   239
        y = 0;
slouken@2737
   240
    else
slouken@2737
   241
        y = window->y;
slouken@2737
   242
slouken@2737
   243
    if (window->x == SDL_WINDOWPOS_UNDEFINED)
slouken@2737
   244
        x = 0;
slouken@2737
   245
    else
slouken@2737
   246
        x = window->x;
slouken@2737
   247
slouken@2737
   248
    if (window->flags & SDL_WINDOW_FULLSCREEN) {
slouken@2737
   249
        x = 0;
slouken@2737
   250
        y = 0;
slouken@2737
   251
    }
couriersud@3023
   252
    DirectFB_WM_AdjustWindowLayout(window);
slouken@2737
   253
    windata->window->MoveTo(windata->window, x, y);
slouken@2737
   254
}
slouken@2737
   255
slouken@2737
   256
void
slouken@2737
   257
DirectFB_SetWindowSize(_THIS, SDL_Window * window)
slouken@2737
   258
{
couriersud@3023
   259
    SDL_DFB_DEVICEDATA(_this);
couriersud@3023
   260
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   261
    int ret;
slouken@2737
   262
slouken@2737
   263
    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
slouken@2737
   264
        int cw;
slouken@2737
   265
        int ch;
slouken@2737
   266
slouken@2737
   267
        /* Make sure all events are disabled for this operation ! */
couriersud@3023
   268
        SDL_DFB_CHECKERR(windata->window->DisableEvents(windata->window,
couriersud@3023
   269
                                                        DWET_ALL));
couriersud@3023
   270
couriersud@3023
   271
        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &cw, &ch));
couriersud@3023
   272
couriersud@3023
   273
        if (cw != window->w || ch != window->h) {
slouken@2737
   274
couriersud@3023
   275
            DirectFB_WM_AdjustWindowLayout(window);
couriersud@3023
   276
            SDL_DFB_CHECKERR(windata->window->Resize(windata->window,
couriersud@3023
   277
                                                     windata->size.w,
couriersud@3023
   278
                                                     windata->size.h));
couriersud@3023
   279
        }
slouken@2737
   280
couriersud@3023
   281
        SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window,
couriersud@3023
   282
                                                       DWET_ALL));
couriersud@3023
   283
slouken@3040
   284
        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
slouken@3040
   285
                         (_this, window, &window->w, &window->h));
slouken@2737
   286
slouken@2737
   287
        SDL_OnWindowResized(window);
slouken@2737
   288
    }
slouken@2737
   289
    return;
slouken@2737
   290
  error:
slouken@2737
   291
    windata->window->EnableEvents(windata->window, DWET_ALL);
slouken@2737
   292
    return;
slouken@2737
   293
}
slouken@2737
   294
slouken@2737
   295
void
slouken@2737
   296
DirectFB_ShowWindow(_THIS, SDL_Window * window)
slouken@2737
   297
{
slouken@2737
   298
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   299
slouken@2737
   300
    windata->window->SetOpacity(windata->window, windata->opacity);
slouken@2737
   301
slouken@2737
   302
}
slouken@2737
   303
slouken@2737
   304
void
slouken@2737
   305
DirectFB_HideWindow(_THIS, SDL_Window * window)
slouken@2737
   306
{
slouken@2737
   307
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   308
slouken@2737
   309
    windata->window->GetOpacity(windata->window, &windata->opacity);
slouken@2737
   310
    windata->window->SetOpacity(windata->window, 0);
slouken@2737
   311
}
slouken@2737
   312
slouken@2737
   313
void
slouken@2737
   314
DirectFB_RaiseWindow(_THIS, SDL_Window * window)
slouken@2737
   315
{
slouken@2737
   316
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   317
slouken@2737
   318
    windata->window->RaiseToTop(windata->window);
slouken@2737
   319
    windata->window->RequestFocus(windata->window);
slouken@2737
   320
}
slouken@2737
   321
slouken@2737
   322
void
slouken@2737
   323
DirectFB_MaximizeWindow(_THIS, SDL_Window * window)
slouken@2737
   324
{
couriersud@3023
   325
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   326
couriersud@3023
   327
    if (windata->is_managed) {
slouken@3040
   328
        DirectFB_WM_MaximizeWindow(_this, window);
couriersud@3023
   329
    } else
couriersud@3023
   330
        SDL_Unsupported();
slouken@2737
   331
}
slouken@2737
   332
slouken@2737
   333
void
slouken@2737
   334
DirectFB_MinimizeWindow(_THIS, SDL_Window * window)
slouken@2737
   335
{
slouken@2737
   336
    /* FIXME: Size to 32x32 ? */
slouken@2737
   337
slouken@2737
   338
    SDL_Unsupported();
slouken@2737
   339
}
slouken@2737
   340
slouken@2737
   341
void
slouken@2737
   342
DirectFB_RestoreWindow(_THIS, SDL_Window * window)
slouken@2737
   343
{
couriersud@3023
   344
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   345
couriersud@3023
   346
    if (windata->is_managed) {
slouken@3040
   347
        DirectFB_WM_RestoreWindow(_this, window);
couriersud@3023
   348
    } else
couriersud@3023
   349
        SDL_Unsupported();
slouken@2737
   350
}
slouken@2737
   351
slouken@2737
   352
void
slouken@2737
   353
DirectFB_SetWindowGrab(_THIS, SDL_Window * window)
slouken@2737
   354
{
slouken@2737
   355
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   356
couriersud@3023
   357
    if ((window->flags & SDL_WINDOW_INPUT_GRABBED)) {
slouken@2737
   358
        windata->window->GrabPointer(windata->window);
slouken@2737
   359
        windata->window->GrabKeyboard(windata->window);
slouken@2737
   360
    } else {
slouken@2737
   361
        windata->window->UngrabPointer(windata->window);
slouken@2737
   362
        windata->window->UngrabKeyboard(windata->window);
slouken@2737
   363
    }
slouken@2737
   364
}
slouken@2737
   365
slouken@2737
   366
void
slouken@2737
   367
DirectFB_DestroyWindow(_THIS, SDL_Window * window)
slouken@2737
   368
{
slouken@2737
   369
    SDL_DFB_DEVICEDATA(_this);
slouken@2737
   370
    SDL_DFB_WINDOWDATA(window);
slouken@2737
   371
    DFB_WindowData *p;
slouken@2737
   372
slouken@2737
   373
    SDL_DFB_DEBUG("Trace\n");
slouken@2737
   374
couriersud@3023
   375
    /* Some cleanups */
couriersud@3023
   376
    windata->window->UngrabPointer(windata->window);
couriersud@3023
   377
    windata->window->UngrabKeyboard(windata->window);
couriersud@3023
   378
couriersud@3023
   379
    windata->window_surface->SetFont(windata->window_surface, NULL);
couriersud@3023
   380
    SDL_DFB_RELEASE(windata->icon);
slouken@2737
   381
    SDL_DFB_RELEASE(windata->eventbuffer);
slouken@2737
   382
    SDL_DFB_RELEASE(windata->surface);
couriersud@3023
   383
    SDL_DFB_RELEASE(windata->window_surface);
couriersud@3023
   384
slouken@2737
   385
    SDL_DFB_RELEASE(windata->window);
slouken@2737
   386
slouken@2737
   387
    /* Remove from list ... */
slouken@2737
   388
slouken@2737
   389
    p = devdata->firstwin;
slouken@2737
   390
    while (p && p->next != windata)
slouken@2737
   391
        p = p->next;
slouken@2737
   392
    if (p)
slouken@2737
   393
        p->next = windata->next;
slouken@2737
   394
    else
slouken@2737
   395
        devdata->firstwin = windata->next;
slouken@2737
   396
    SDL_free(windata);
slouken@2737
   397
    return;
slouken@2737
   398
}
slouken@2737
   399
slouken@2737
   400
SDL_bool
slouken@2737
   401
DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window,
slouken@2737
   402
                         struct SDL_SysWMinfo * info)
slouken@2737
   403
{
slouken@2737
   404
    SDL_Unsupported();
slouken@2737
   405
    return SDL_FALSE;
slouken@2737
   406
}
couriersud@3023
   407
couriersud@3023
   408
void
couriersud@3023
   409
DirectFB_AdjustWindowSurface(SDL_Window * window)
couriersud@3023
   410
{
couriersud@3023
   411
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   412
    int adjust = windata->wm_needs_redraw;
couriersud@3023
   413
    int cw, ch;
couriersud@3023
   414
    int ret;
couriersud@3023
   415
couriersud@3023
   416
    DirectFB_WM_AdjustWindowLayout(window);
couriersud@3023
   417
couriersud@3023
   418
    SDL_DFB_CHECKERR(windata->
couriersud@3023
   419
                     window_surface->GetSize(windata->window_surface, &cw,
couriersud@3023
   420
                                             &ch));
couriersud@3023
   421
    if (cw != windata->size.w || ch != windata->size.h) {
couriersud@3023
   422
        adjust = 1;
couriersud@3023
   423
    }
couriersud@3023
   424
couriersud@3023
   425
    if (adjust) {
couriersud@3038
   426
#if DFB_VERSION_ATLEAST(1,2,1)
slouken@3040
   427
        SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
couriersud@3023
   428
                                                        windata->size.w,
couriersud@3023
   429
                                                        windata->size.h));
slouken@3040
   430
        SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
couriersud@3023
   431
                                                          windata->
couriersud@3023
   432
                                                          window_surface,
couriersud@3023
   433
                                                          &windata->client));
couriersud@3037
   434
#else
slouken@3040
   435
        DFBWindowOptions opts;
slouken@3040
   436
slouken@3040
   437
        SDL_DFB_CHECKERR(windata->window->GetOptions(windata->window, &opts));
slouken@3040
   438
        /* recreate subsurface */
slouken@3040
   439
        SDL_DFB_RELEASE(windata->surface);
couriersud@3039
   440
slouken@3040
   441
        if (opts & DWOP_SCALE)
slouken@3040
   442
            SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
slouken@3040
   443
                                                            windata->size.w,
slouken@3040
   444
                                                            windata->size.h));
slouken@3040
   445
        SDL_DFB_CHECKERR(windata->window_surface->
slouken@3040
   446
                         GetSubSurface(windata->window_surface,
slouken@3040
   447
                                       &windata->client, &windata->surface));
couriersud@3037
   448
#endif
slouken@3040
   449
        DirectFB_WM_RedrawLayout(window);
couriersud@3023
   450
    }
couriersud@3023
   451
  error:
couriersud@3023
   452
    return;
couriersud@3023
   453
}