From 76532c49651a372a25010bc7f7f8b60eeebefdfd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 10 Oct 2012 18:44:33 +0200 Subject: Re-grab focus after failed login attempt --- LockWindow.py | 10 +++++----- pylock.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LockWindow.py b/LockWindow.py index d6f6ae3..97a8611 100644 --- a/LockWindow.py +++ b/LockWindow.py @@ -76,7 +76,7 @@ class LockWindow(Gtk.Window): self.logoutButton.connect('clicked', lambda w: self._logout()) self.unlockButton.connect('clicked', lambda w: self._tryUnlock()) - self.reset(True) + self.reset(False, True) self.deviceManager = self.display.get_device_manager() @@ -100,7 +100,7 @@ class LockWindow(Gtk.Window): self.logoutButton.set_sensitive(self._enableLogoutButton) self.unlockButton.set_sensitive(self._enableUnlockButton) - def reset(self, resetButtons = False): + def reset(self, regrab = True, resetButtons = False): if resetButtons: self._enablePromptEntry = True self._enableLogoutButton = False @@ -110,8 +110,8 @@ class LockWindow(Gtk.Window): self.messageLabel.set_label('') self._update() - self.promptEntry.grab_focus() - + if regrab: + self._grabDevices(None, None) def updateLockMessage(self, username, logoutTime = None): if logoutTime is None: @@ -153,4 +153,4 @@ class LockWindow(Gtk.Window): self._ungrabDevices() self.hide() - self.reset(True) + self.reset(False, True) diff --git a/pylock.py b/pylock.py index f4841cd..159b7d2 100644 --- a/pylock.py +++ b/pylock.py @@ -99,7 +99,7 @@ def logout(): except: pass - window.reset() + window.reset(False) def updateTimeout(timeLeft): window.updateLockMessage(args.username, timeLeft) -- cgit v1.2.3