src/video/x11/SDL_x11window.c
changeset 5531 477f550f6efd
parent 5481 22dfc3958dc3
child 5535 96594ac5fd1a
equal deleted inserted replaced
5530:4e46a7b6773d 5531:477f550f6efd
   770     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
   770     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
   771     Display *display = data->videodata->display;
   771     Display *display = data->videodata->display;
   772 
   772 
   773     if (SDL_IsShapedWindow(window))
   773     if (SDL_IsShapedWindow(window))
   774         X11_ResizeWindowShape(window);
   774         X11_ResizeWindowShape(window);
   775     XResizeWindow(display, data->xwindow, window->w, window->h);
   775     if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
       
   776          /* Apparently, if the X11 Window is set to a 'non-resizable' window, you cannot resize it using the XResizeWindow, thus
       
   777             we must set the size hints to adjust the window size.*/
       
   778          XSizeHints *sizehints = XAllocSizeHints();
       
   779          long userhints;
       
   780 
       
   781          XGetWMNormalHints(display, data->xwindow, sizehints, &userhints);
       
   782 
       
   783          sizehints->min_width = sizehints->max_height = window->w;
       
   784          sizehints->min_height = sizehints->max_height = window->h;
       
   785 
       
   786          XSetWMNormalHints(display, data->xwindow, sizehints);
       
   787 
       
   788          XFree(sizehints);
       
   789     } else
       
   790         XResizeWindow(display, data->xwindow, window->w, window->h);
   776     XFlush(display);
   791     XFlush(display);
   777 }
   792 }
   778 
   793 
   779 void
   794 void
   780 X11_ShowWindow(_THIS, SDL_Window * window)
   795 X11_ShowWindow(_THIS, SDL_Window * window)