src/video/x11/SDL_x11window.c
changeset 6541 be103236441d
parent 6540 44459e2f6e4d
child 6562 c52863165594
     1.1 --- a/src/video/x11/SDL_x11window.c	Wed Oct 03 12:19:55 2012 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Wed Oct 03 12:33:42 2012 -0700
     1.3 @@ -758,6 +758,36 @@
     1.4           XSetWMNormalHints(display, data->xwindow, sizehints);
     1.5  
     1.6           XFree(sizehints);
     1.7 +
     1.8 +        /* From Pierre-Loup:
     1.9 +           For the windowed resize problem; WMs each have their little quirks with
    1.10 +           that.  When you change the size hints, they get a ConfigureNotify event
    1.11 +           with the WM_NORMAL_SIZE_HINTS Atom.  They all save the hints then, but
    1.12 +           they don't all resize the window right away to enforce the new hints.
    1.13 +           Those who do properly do it are:
    1.14 +          
    1.15 +             - XFWM
    1.16 +             - metacity
    1.17 +             - KWin
    1.18 +
    1.19 +           These are great.  Now, others are more problematic as you could observe
    1.20 +           first hand.  Compiz/Unity only falls into the code that does it on select
    1.21 +           actions, such as window move, raise, map, etc.
    1.22 +
    1.23 +           WindowMaker is even more difficult and will _only_ do it on map.
    1.24 +
    1.25 +           Awesome only does it on user-initiated moves as far as I can tell.
    1.26 +          
    1.27 +           Your raise workaround only fixes compiz/Unity.  With that all "modern"
    1.28 +           window managers are covered.  Trying to Hide/Show on windowed resize
    1.29 +           (UnMap/Map) fixes both Unity and WindowMaker, but introduces subtle
    1.30 +           problems with transitioning from Windowed to Fullscreen on Unity.  Since
    1.31 +           some window moves happen after the transitions to fullscreen, that forces
    1.32 +           SDL to fall from windowed to fullscreen repeatedly and it sometimes leaves
    1.33 +           itself in a state where the fullscreen window is slightly offset by what
    1.34 +           used to be the window decoration titlebar.
    1.35 +        */
    1.36 +        XRaiseWindow(display, data->xwindow);
    1.37      } else {
    1.38          XResizeWindow(display, data->xwindow, window->w, window->h);
    1.39      }