Skip to content

Commit

Permalink
Merge pull request #22549 from ccordoba12/issue-20851
Browse files Browse the repository at this point in the history
PR: Prevent storing a negative position when saving the main window settings (Layout)
  • Loading branch information
ccordoba12 authored Sep 22, 2024
2 parents d827dcf + a799c1b commit 40c61a9
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 40c61a9

Please sign in to comment.