diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index 74aba590c6e..eccafc7b4a7 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -1319,6 +1319,17 @@ def load_window_settings(self, prefix, default=False, section='main'): else: hexstate = get_func(section, prefix+'state', None) pos = get_func(section, prefix+'position') + + # It's necessary to verify if the window/position value is valid + # with the current screen. See issue 3748 + width = pos[0] + height = pos[1] + screen_shape = QApplication.desktop().geometry() + current_width = screen_shape.width() + current_height = screen_shape.height() + if current_width < width or current_height < height: + pos = CONF.get_default(section, prefix+'position') + is_maximized = get_func(section, prefix+'is_maximized') is_fullscreen = get_func(section, prefix+'is_fullscreen') return hexstate, window_size, prefs_dialog_size, pos, is_maximized, \