Skip to content

Commit

Permalink
Merge from 3.x: PR #3754
Browse files Browse the repository at this point in the history
Fixes #3748
  • Loading branch information
ccordoba12 committed Dec 2, 2016
2 parents dd6f564 + 10df073 commit 7a5abec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spyder/app/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down

0 comments on commit 7a5abec

Please sign in to comment.