diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 01:44:06 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 01:44:06 +0000 |
commit | adc4ed4a6e4dbc0a599a2b2981caeeebe3565b08 (patch) | |
tree | 45d359a694e20efeb448273aa8c30e1a34cdb973 | |
parent | cf6eb152a424515298b0f209de97cf0a92568764 (diff) | |
download | chromium_src-adc4ed4a6e4dbc0a599a2b2981caeeebe3565b08.zip chromium_src-adc4ed4a6e4dbc0a599a2b2981caeeebe3565b08.tar.gz chromium_src-adc4ed4a6e4dbc0a599a2b2981caeeebe3565b08.tar.bz2 |
Screenlocker fixes.
* Fix regression where gkt menu didn't close itself when screen is locked.
putting gtk_add_grab() back before removing all of grab widget.
This was also causing the problem
* Fix copy&paste error in HandleGrabBroke. It was not checking mouse_grab_status
* Enable double buffering to avoid flicker on native textfield.
* Add more logging to help troubleshooting problem in release build.
BUG=chromium-os:4222
TEST=see bug for instruction how to reproduce the bug. Screen Locker should kick in even with menu opened and unlocking should work too.
Review URL: http://codereview.chromium.org/2868024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50806 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/login/screen_locker.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 284a2bc..869a1d9 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -152,6 +152,7 @@ class LockWindow : public views::WidgetGtk { LockWindow() : WidgetGtk(views::WidgetGtk::TYPE_POPUP), toplevel_focus_widget_(NULL) { + EnableDoubleBuffer(true); } // GTK propagates key events from parents to children. @@ -205,6 +206,9 @@ class GrabWidget : public views::WidgetGtk { virtual void Show() { views::WidgetGtk::Show(); GtkWidget* current_grab_window; + // Grab gtk input first so that the menu holding grab will close itself. + gtk_grab_add(window_contents()); + // Make sure there is no grab widget so that gtk simply propagates // an event. This is necessary to allow message bubble and password // field, button to process events simultaneously. GTK @@ -555,6 +559,8 @@ void ScreenLocker::Show() { ScreenLocker* locker = new ScreenLocker(UserManager::Get()->logged_in_user()); locker->Init(bounds); + } else { + LOG(INFO) << "Show(): screen locker already exists. ignoring"; } } @@ -562,9 +568,8 @@ void ScreenLocker::Show() { void ScreenLocker::Hide() { DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); DCHECK(screen_locker_); - gdk_keyboard_ungrab(GDK_CURRENT_TIME); - gdk_pointer_ungrab(GDK_CURRENT_TIME); - MessageLoop::current()->DeleteSoon(FROM_HERE, screen_locker_); + LOG(INFO) << "Hide Screen Locker:" << screen_locker_; + MessageLoopForUI::current()->DeleteSoon(FROM_HERE, screen_locker_); } // static @@ -590,11 +595,16 @@ void ScreenLocker::InitClass() { // ScreenLocker, private: ScreenLocker::~ScreenLocker() { + DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); ClearErrors(); if (input_event_observer_.get()) MessageLoopForUI::current()->RemoveObserver(input_event_observer_.get()); + gdk_keyboard_ungrab(GDK_CURRENT_TIME); + gdk_pointer_ungrab(GDK_CURRENT_TIME); + DCHECK(lock_window_); + LOG(INFO) << "Closing ScreenLocker window"; lock_window_->Close(); // lock_widget_ will be deleted by gtk's destroy signal. screen_locker_ = NULL; |