summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/gtk/info_bubble_gtk.cc7
-rw-r--r--chrome/browser/gtk/info_bubble_gtk.h8
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/gtk/info_bubble_gtk.cc b/chrome/browser/gtk/info_bubble_gtk.cc
index 5708818..8c8cbad 100644
--- a/chrome/browser/gtk/info_bubble_gtk.cc
+++ b/chrome/browser/gtk/info_bubble_gtk.cc
@@ -192,6 +192,8 @@ void InfoBubbleGtk::Init(GtkWindow* transient_toplevel,
G_CALLBACK(&HandleButtonPressThunk), this);
g_signal_connect(window_, "destroy",
G_CALLBACK(&HandleDestroyThunk), this);
+ g_signal_connect(window_, "focus-out-event",
+ G_CALLBACK(&HandleFocusOutThunk), this);
gtk_widget_show_all(window_);
// Make sure our window has focus, is brought to the top, etc.
@@ -248,3 +250,8 @@ gboolean InfoBubbleGtk::HandleDestroy() {
delete this;
return FALSE; // Propagate.
}
+
+gboolean InfoBubbleGtk::HandleFocusOut(GdkEventButton* event) {
+ Close();
+ return FALSE; // Propagate.
+}
diff --git a/chrome/browser/gtk/info_bubble_gtk.h b/chrome/browser/gtk/info_bubble_gtk.h
index 695537a..ac08aa0 100644
--- a/chrome/browser/gtk/info_bubble_gtk.h
+++ b/chrome/browser/gtk/info_bubble_gtk.h
@@ -103,6 +103,14 @@ class InfoBubbleGtk {
}
gboolean HandleDestroy();
+ static gboolean HandleFocusOutThunk(GtkWidget* widget,
+ GdkEventButton* event,
+ gpointer userdata) {
+ return reinterpret_cast<InfoBubbleGtk*>(userdata)->
+ HandleFocusOut(event);
+ }
+ gboolean HandleFocusOut(GdkEventButton* event);
+
// The caller supplied delegate, can be NULL.
InfoBubbleGtkDelegate* delegate_;