diff options
| author | Brandon Schaefer <brandontschaefer@gmail.com> | 2014-03-28 10:15:22 +0000 |
|---|---|---|
| committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-03-28 10:15:22 +0000 |
| commit | f5fbb2ffddb6e0ca4b6ec6aa3d31d9d15e75c6f3 (patch) | |
| tree | f800cdc838540e041fa6aebf2b11c0dd3ad2fe81 | |
| parent | 264ad1757eeac2f203ab52513345084359ad88ec (diff) | |
| parent | 1c0cdfcd5bb70dbb7c5590dae95329a0989cea36 (diff) | |
When we see an escape in lockscreen prompt, clear the password. Fixes: 1292647
(bzr r3745)
| -rw-r--r-- | lockscreen/UserPromptView.cpp | 13 | ||||
| -rw-r--r-- | lockscreen/UserPromptView.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lockscreen/UserPromptView.cpp b/lockscreen/UserPromptView.cpp index 28163b9d8..dfcf48a25 100644 --- a/lockscreen/UserPromptView.cpp +++ b/lockscreen/UserPromptView.cpp @@ -125,6 +125,19 @@ UserPromptView::UserPromptView(session::Manager::Ptr const& session_manager) sigc::mem_fun(this, &UserPromptView::AuthenticationCb)); } +bool UserPromptView::InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character) +{ + if ((eventType == nux::NUX_KEYDOWN) && (key_sym == NUX_VK_ESCAPE)) + { + if (!focus_queue_.empty()) + focus_queue_.front()->SetText(""); + + return true; + } + + return false; +} + void UserPromptView::ResetLayout() { focus_queue_.clear(); diff --git a/lockscreen/UserPromptView.h b/lockscreen/UserPromptView.h index 7d5ea4336..54c7a5c49 100644 --- a/lockscreen/UserPromptView.h +++ b/lockscreen/UserPromptView.h @@ -64,6 +64,8 @@ protected: private: void ResetLayout(); + bool InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character); + session::Manager::Ptr session_manager_; UserAuthenticatorPam user_authenticator_; std::shared_ptr<nux::AbstractPaintLayer> bg_layer_; |
