docs: def set_window_size_and_position(window, window_key):
      """Adjust GTK Window's size, position and maximized state according to the corresponding values in the
      runtime_config file. The maximize method is triggered last to restore also the last stored size and position of the
      window. If the runtime_config does not exist, or the corresponding values are missing in the file, default values
      for the window size are used, and the mouse position is used to adjust the window's position.
  
      :param window: The GTK Window to be adjusted
      :param window_key: The window's key stored in the runtime config file
       """
      size = global_runtime_config.get_config_value(window_key + '_WINDOW_SIZE')
      position = global_runtime_config.get_config_value(window_key + '_WINDOW_POS')
      maximized = global_runtime_config.get_config_value(window_key + '_WINDOW_MAXIMIZED')
  
      # un-maximize here on purpose otherwise resize and reposition fails
      if not maximized:
          window.unmaximize()
  
      if not size:
          size = constants.WINDOW_SIZE[window_key + '_WINDOW']
      window.resize(*size)
      if position:
          position = (max(0, position[0]), max(0, position[1]))
          screen_width = Gdk.Screen.width()
          screen_height = Gdk.Screen.height()
          if position[0] < screen_width and position[1] < screen_height:
              window.move(*position)
      else:
          window.set_position(Gtk.WindowPosition.MOUSE)
      if maximized:
          window.maximize()
      window.show()