diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 21:44:28 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 21:44:28 +0000 |
commit | d19ae08a3877aa4f005018ce18f6f2a21831b24c (patch) | |
tree | 63141682fbad78ef8b1551b0c21375569b4b8db9 /chrome/browser/chromeos | |
parent | 216932c9ac94aab93a744d260892d1a752910ed1 (diff) | |
download | chromium_src-d19ae08a3877aa4f005018ce18f6f2a21831b24c.zip chromium_src-d19ae08a3877aa4f005018ce18f6f2a21831b24c.tar.gz chromium_src-d19ae08a3877aa4f005018ce18f6f2a21831b24c.tar.bz2 |
Clear Grab everytime before tring to grab input
It's not clear why it's failing to grab the input.
This could be because someone is stealing the grab at the same time and I lost.
This CL changes TryGrabAllIput so that next time it will succeeds.
BUG=chromium-os:5902
TEST=none
Review URL: http://codereview.chromium.org/3134040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r-- | chrome/browser/chromeos/login/screen_locker.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 2692fad..c8f1f06 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -213,6 +213,11 @@ class GrabWidget : public views::WidgetGtk { virtual void Show() { views::WidgetGtk::Show(); + // Now steal all inputs. + TryGrabAllInputs(); + } + + void ClearGrab() { GtkWidget* current_grab_window; // Grab gtk input first so that the menu holding grab will close itself. gtk_grab_add(window_contents()); @@ -224,9 +229,6 @@ class GrabWidget : public views::WidgetGtk { // until it's empty. while ((current_grab_window = gtk_grab_get_current()) != NULL) gtk_grab_remove(current_grab_window); - - // Now steal all inputs. - TryGrabAllInputs(); } virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event) { @@ -263,6 +265,8 @@ class GrabWidget : public views::WidgetGtk { }; void GrabWidget::TryGrabAllInputs() { + ClearGrab(); + if (kbd_grab_status_ != GDK_GRAB_SUCCESS) { kbd_grab_status_ = gdk_keyboard_grab(window_contents()->window, FALSE, GDK_CURRENT_TIME); |