src/events/SDL_windowevents.c
changeset 5249 7a963be087ef
parent 5166 4d39eeaad00b
child 5261 595814f561f7
     1.1 --- a/src/events/SDL_windowevents.c	Thu Feb 10 22:49:14 2011 -0800
     1.2 +++ b/src/events/SDL_windowevents.c	Fri Feb 11 00:25:44 2011 -0800
     1.3 @@ -82,24 +82,35 @@
     1.4          SDL_OnWindowHidden(window);
     1.5          break;
     1.6      case SDL_WINDOWEVENT_MOVED:
     1.7 -        if (window->flags & SDL_WINDOW_FULLSCREEN) {
     1.8 +        if (SDL_WINDOWPOS_ISUNDEFINED(data1) ||
     1.9 +            SDL_WINDOWPOS_ISUNDEFINED(data2)) {
    1.10              return 0;
    1.11          }
    1.12 -        if (data1 == SDL_WINDOWPOS_UNDEFINED) {
    1.13 -            data1 = window->x;
    1.14 -        }
    1.15 -        if (data2 == SDL_WINDOWPOS_UNDEFINED) {
    1.16 -            data2 = window->y;
    1.17 +        if (window->flags & SDL_WINDOW_FULLSCREEN) {
    1.18 +            window->fullscreen.x = data1;
    1.19 +            window->fullscreen.y = data1;
    1.20 +        } else {
    1.21 +            window->windowed.x = data1;
    1.22 +            window->windowed.y = data1;
    1.23          }
    1.24          if (data1 == window->x && data2 == window->y) {
    1.25              return 0;
    1.26          }
    1.27          window->x = data1;
    1.28          window->y = data2;
    1.29 +
    1.30 +        if (window->flags & SDL_WINDOW_FULLSCREEN) {
    1.31 +            /* Do we really want to do this? */
    1.32 +            return 0;
    1.33 +        }
    1.34          break;
    1.35      case SDL_WINDOWEVENT_RESIZED:
    1.36          if (window->flags & SDL_WINDOW_FULLSCREEN) {
    1.37 -            return 0;
    1.38 +            window->fullscreen.w = data1;
    1.39 +            window->fullscreen.h = data1;
    1.40 +        } else {
    1.41 +            window->windowed.w = data1;
    1.42 +            window->windowed.h = data1;
    1.43          }
    1.44          if (data1 == window->w && data2 == window->h) {
    1.45              return 0;
    1.46 @@ -107,6 +118,11 @@
    1.47          window->w = data1;
    1.48          window->h = data2;
    1.49          SDL_OnWindowResized(window);
    1.50 +
    1.51 +        if (window->flags & SDL_WINDOW_FULLSCREEN) {
    1.52 +            /* Do we really want to do this? */
    1.53 +            return 0;
    1.54 +        }
    1.55          break;
    1.56      case SDL_WINDOWEVENT_MINIMIZED:
    1.57          if (window->flags & SDL_WINDOW_MINIMIZED) {