| Index: chrome/browser/ui/gtk/bubble/bubble_gtk.cc
|
| diff --git a/chrome/browser/ui/gtk/bubble/bubble_gtk.cc b/chrome/browser/ui/gtk/bubble/bubble_gtk.cc
|
| index 4ffee09feb9ff5c5eb682603ba85cbf39077d797..d4cbee68608f8862452ef134b2b06450e31fdf6d 100644
|
| --- a/chrome/browser/ui/gtk/bubble/bubble_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/bubble/bubble_gtk.cc
|
| @@ -179,6 +179,10 @@ void BubbleGtk::Init(GtkWidget* anchor_widget,
|
| G_CALLBACK(OnButtonPressThunk), this);
|
| signals_.Connect(window_, "destroy", G_CALLBACK(OnDestroyThunk), this);
|
| signals_.Connect(window_, "hide", G_CALLBACK(OnHideThunk), this);
|
| + if (grab_input_) {
|
| + signals_.Connect(window_, "grab-broken-event",
|
| + G_CALLBACK(OnGrabBrokenThunk), this);
|
| + }
|
|
|
| // If the toplevel window is being used as the anchor, then the signals below
|
| // are enough to keep us positioned correctly.
|
| @@ -462,11 +466,6 @@ void BubbleGtk::Observe(int type,
|
| }
|
| }
|
|
|
| -void BubbleGtk::HandlePointerAndKeyboardUngrabbedByContent() {
|
| - if (grab_input_)
|
| - GrabPointerAndKeyboard();
|
| -}
|
| -
|
| void BubbleGtk::StopGrabbingInput() {
|
| if (!grab_input_)
|
| return;
|
| @@ -650,6 +649,30 @@ void BubbleGtk::OnHide(GtkWidget* widget) {
|
| gtk_widget_destroy(widget);
|
| }
|
|
|
| +gboolean BubbleGtk::OnGrabBroken(GtkWidget* widget,
|
| + GdkEventGrabBroken* grab_broken) {
|
| + // |grab_input_| may have been changed to false.
|
| + if (!grab_input_)
|
| + return false;
|
| +
|
| + gpointer user_data;
|
| + gdk_window_get_user_data(grab_broken->grab_window, &user_data);
|
| +
|
| + if (GTK_IS_WIDGET(user_data)) {
|
| + signals_.Connect(GTK_WIDGET(user_data), "hide",
|
| + G_CALLBACK(OnForeshadowWidgetHideThunk), this);
|
| + }
|
| +
|
| + return FALSE;
|
| +}
|
| +
|
| +void BubbleGtk::OnForeshadowWidgetHide(GtkWidget* widget) {
|
| + if (grab_input_)
|
| + GrabPointerAndKeyboard();
|
| +
|
| + signals_.DisconnectAll(widget);
|
| +}
|
| +
|
| gboolean BubbleGtk::OnToplevelConfigure(GtkWidget* widget,
|
| GdkEventConfigure* event) {
|
| if (!UpdateArrowLocation(false))
|
|
|