title: How to detect resizeable window state in pygame and de-maximize it in Linux?
body: <p>I have an application built in python with use of pygame that initially displays a login screen at a set size which is not RESIZABLE and then when user logs into the game the saved settings are being used to transform the window size. The window is turned into RESIZABLE after login. If user logs out the window is changed back to the initial size without RESIZABLE flag. Everything is OK as long as the user logs out from normal window, but when user hits the maximize button and then logs out in some distros the window still stays maximized and the login screen is being painted in a top left corner of the window.</p>
  
  <p>And here comes the question, is there a way of detecting whether the window has been maximized so I can de-maximize it before sizing down?</p>
  
  <p>I couldn't find anything that would help me with this in the pygame docs or anywhere online. I have found a way of getting a "handle" to the window by using:</p>
  
  <pre><code>pygame.display.get_wm_info()['window']
  </code></pre>
  
  <p>but not sure where to take it from here.</p>
  
  <p>The way I set the sizes:</p>
  
  <pre><code>self.screen = pygame.display.set_mode((800, 480)) #login screen
  self.screen = pygame.display.set_mode(user_saved_size, pygame.RESIZABLE) #game screen
  </code></pre>