Do not save or restore window position

This commit is contained in:
Teemu Ikonen 2020-12-27 18:18:11 +02:00
parent c967f33583
commit 529a1e9425
1 changed files with 1 additions and 7 deletions

View File

@ -158,10 +158,7 @@ class UIConfig(config.Config):
if cfg.width != -1 and cfg.height != -1:
window.resize(cfg.width, cfg.height)
if cfg.x == -1 or cfg.y == -1:
window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
else:
window.move(cfg.x, cfg.y)
window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
# Ignore events while we're connecting to the window
self.__ignore_window_events = True
@ -169,12 +166,9 @@ class UIConfig(config.Config):
# Get window state, correct size comes from window.get_size(),
# see https://developer.gnome.org/SaveWindowState/
def _receive_configure_event(widget, event):
x_pos, y_pos = event.x, event.y
width_size, height_size = widget.get_size()
maximized = bool(event.window.get_state() & Gdk.WindowState.MAXIMIZED)
if not self.__ignore_window_events and not maximized:
cfg.x = x_pos
cfg.y = y_pos
cfg.width = width_size
cfg.height = height_size