Skip to content

Commit

Permalink
Layout: Prevent storing a negative position when saving window settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Sep 22, 2024
1 parent 9953730 commit a799c1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spyder/plugins/layout/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,10 @@ def save_current_window_settings(self, prefix, section='main',
)
self.set_conf(
prefix + 'position',
(pos.x(), pos.y()),
# We need to do these validations to avoid an error that breaks
# doing mouse clicks in WSL.
# Fixes spyder-ide/spyder#20851
(pos.x() if pos.x() > 0 else 0, pos.y() if pos.y() > 0 else 0),
section=section,
)

Expand Down

0 comments on commit a799c1b

Please sign in to comment.