diff --git a/spyder/plugins/layout/plugin.py b/spyder/plugins/layout/plugin.py index 927c789e715..c5489b2fa45 100644 --- a/spyder/plugins/layout/plugin.py +++ b/spyder/plugins/layout/plugin.py @@ -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, )