diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 20:51:30 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 20:51:30 +0000 |
commit | 3bc3a7bb2bfdaac7466db68ed59343903778c51e (patch) | |
tree | cddaddba0dc864ddb8517854cdfdc096c9044d89 /chrome | |
parent | 37a7f62c650cc960178ce9988a31bf635ce90161 (diff) | |
download | chromium_src-3bc3a7bb2bfdaac7466db68ed59343903778c51e.zip chromium_src-3bc3a7bb2bfdaac7466db68ed59343903778c51e.tar.gz chromium_src-3bc3a7bb2bfdaac7466db68ed59343903778c51e.tar.bz2 |
Remove all grab widget in screen locker so that gtk simply propagate events,
instead of adding window_contents_ as grab widget.
Explicitly adding grab widget was confusing gtk and the event has been handled by grab widget rather than by the window the event is forwarded to.
This CL fixes it by removing all grab widget and let gtk propagage event in target window.
BUG=none
TEST=open screen locker, type wrong password to show message bubble,
then close it by clicking close (x) button.
Review URL: http://codereview.chromium.org/2788001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chromeos/login/screen_locker.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 45f670d..8d67d3b 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -16,17 +16,16 @@ #include "chrome/browser/chromeos/login/login_utils.h" #include "chrome/browser/chromeos/login/message_bubble.h" #include "chrome/browser/chromeos/login/screen_lock_view.h" +#include "chrome/browser/chromeos/wm_ipc.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "third_party/cros/chromeos_wm_ipc_enums.h" #include "views/screen.h" #include "views/widget/root_view.h" #include "views/widget/widget_gtk.h" -#include "chrome/browser/chromeos/wm_ipc.h" -#include "third_party/cros/chromeos_wm_ipc_enums.h" - namespace { // The maxium times that the screen locker should try to grab input, // and its interval. It has to be able to grab all inputs in 30 seconds, @@ -88,12 +87,15 @@ class GrabWidget : public views::WidgetGtk { virtual void Show() { views::WidgetGtk::Show(); - GtkWidget* current_grab_window = gtk_grab_get_current(); - if (current_grab_window) + GtkWidget* current_grab_window; + // 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 + // maintains grab widgets in a linked-list, so we need to remove + // until it's empty. + while ((current_grab_window = gtk_grab_get_current()) != NULL) gtk_grab_remove(current_grab_window); - gtk_grab_add(window_contents()); - // Now steal all inputs. TryGrabAllInputs(); } @@ -190,7 +192,6 @@ class MouseEventRelay : public MessageLoopForUI::Observer { virtual void DidProcessEvent(GdkEvent* event) { if (event->any.window != src_) { - DLOG(INFO) << "ignore event src non grab window: " << event->type; return; } |