title: Pygame Display Position While Running
body: <p>I am making a pygame project, and have an issue where the window sets itself in the corner of the screen when I back out of full screen mode. Normally, this wouldn't be an issue but it hides the toolbar off screen, making it impossible to drag the screen around or resize it. I have found <code>pygame.display.toggle_fullscreen()</code> to be far to unreliable and breaks whenever I use it, so I made my own method of toggling fullscreen:</p>
  <pre><code>import pygame, tkinter
  
  fullscr = False
  scrw, srch = tkinter.Tk().winfo_screenwidth(), tkinter.Tk().winfo_screenheight()
  
  while True:
      for event in pygame.event.get():
          if event.type == pygame.KEYUP:
              if event.key == pygame.K_F11:
                  if fullscr:
                      screen = pygame.display.set_mode((scrw, scrh), pygame.RESIZABLE)
                      screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
                  else:
                      screen = pygame.display.set_mode((980, 720), pygame.RESIZABLE)
                  fullscr = not fullscr
  </code></pre>
  <p>For those curious, I set the window to fill the screen before setting it to fullscreen because the window will maintain its aspect ratio, breaking my game and causing weird glitches. I am already aware of <code>os.environ['SDL_VIDEO_CENTERED'] = '1'</code> as a way to center the screen, but this does not work after running <code>pygame.init()</code>. Are there any other ways I can change the windows position, or at least prevent it from hiding the toolbar off screen when toggling out of fullscreen?</p>