756 sizehints->min_height = sizehints->max_height = window->h; |
756 sizehints->min_height = sizehints->max_height = window->h; |
757 |
757 |
758 XSetWMNormalHints(display, data->xwindow, sizehints); |
758 XSetWMNormalHints(display, data->xwindow, sizehints); |
759 |
759 |
760 XFree(sizehints); |
760 XFree(sizehints); |
|
761 |
|
762 /* From Pierre-Loup: |
|
763 For the windowed resize problem; WMs each have their little quirks with |
|
764 that. When you change the size hints, they get a ConfigureNotify event |
|
765 with the WM_NORMAL_SIZE_HINTS Atom. They all save the hints then, but |
|
766 they don't all resize the window right away to enforce the new hints. |
|
767 Those who do properly do it are: |
|
768 |
|
769 - XFWM |
|
770 - metacity |
|
771 - KWin |
|
772 |
|
773 These are great. Now, others are more problematic as you could observe |
|
774 first hand. Compiz/Unity only falls into the code that does it on select |
|
775 actions, such as window move, raise, map, etc. |
|
776 |
|
777 WindowMaker is even more difficult and will _only_ do it on map. |
|
778 |
|
779 Awesome only does it on user-initiated moves as far as I can tell. |
|
780 |
|
781 Your raise workaround only fixes compiz/Unity. With that all "modern" |
|
782 window managers are covered. Trying to Hide/Show on windowed resize |
|
783 (UnMap/Map) fixes both Unity and WindowMaker, but introduces subtle |
|
784 problems with transitioning from Windowed to Fullscreen on Unity. Since |
|
785 some window moves happen after the transitions to fullscreen, that forces |
|
786 SDL to fall from windowed to fullscreen repeatedly and it sometimes leaves |
|
787 itself in a state where the fullscreen window is slightly offset by what |
|
788 used to be the window decoration titlebar. |
|
789 */ |
|
790 XRaiseWindow(display, data->xwindow); |
761 } else { |
791 } else { |
762 XResizeWindow(display, data->xwindow, window->w, window->h); |
792 XResizeWindow(display, data->xwindow, window->w, window->h); |
763 } |
793 } |
764 XFlush(display); |
794 XFlush(display); |
765 } |
795 } |