summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/info_bubble_gtk.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 19:08:28 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 19:08:28 +0000
commitfa4ce08390f4ce6017dda5aa0b753f2f0f7e52a0 (patch)
tree7efca7ac7426b58e8be04b7fe9d8be2c540dc1df /chrome/browser/gtk/info_bubble_gtk.h
parentc87b2881458763fb9d82066bbfd2fe696431e2db (diff)
downloadchromium_src-fa4ce08390f4ce6017dda5aa0b753f2f0f7e52a0.zip
chromium_src-fa4ce08390f4ce6017dda5aa0b753f2f0f7e52a0.tar.gz
chromium_src-fa4ce08390f4ce6017dda5aa0b753f2f0f7e52a0.tar.bz2
GTK: hide the current grab widget when showing an info bubble.
Problem: Extension popups can take a while to appear after the user clicks the icon. If the user clicks something else that causes a grab (like a context or dropdown menu, or another info bubble), then that grab is shadowed and the widget behaves oddly (having two info bubbles open simultaneously, having an unclosable menu, etc.) Solution: Hide any widget that has a grab when the info bubble is being created. Delete info bubbles that get hidden. Etc.: You can still pretty easily get into a weird trapped state when the delayed info bubble interacts with tab dragging. BUG=none TEST=left click then quickly right click a browser action with extension popup Review URL: http://codereview.chromium.org/1317001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42645 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/info_bubble_gtk.h')
-rw-r--r--chrome/browser/gtk/info_bubble_gtk.h75
1 files changed, 17 insertions, 58 deletions
diff --git a/chrome/browser/gtk/info_bubble_gtk.h b/chrome/browser/gtk/info_bubble_gtk.h
index 4d3d763..10274fa 100644
--- a/chrome/browser/gtk/info_bubble_gtk.h
+++ b/chrome/browser/gtk/info_bubble_gtk.h
@@ -15,6 +15,7 @@
#include <gtk/gtk.h>
+#include "app/gtk_signal.h"
#include "base/basictypes.h"
#include "chrome/common/notification_registrar.h"
#include "gfx/point.h"
@@ -139,65 +140,23 @@ class InfoBubbleGtk : public NotificationObserver {
// sure that we have the input focus.
void GrabPointerAndKeyboard();
- static gboolean HandleEscapeThunk(GtkAccelGroup* group,
- GObject* acceleratable,
- guint keyval,
- GdkModifierType modifier,
- gpointer user_data) {
- return reinterpret_cast<InfoBubbleGtk*>(user_data)->HandleEscape();
+ static gboolean OnEscapeThunk(GtkAccelGroup* group,
+ GObject* acceleratable,
+ guint keyval,
+ GdkModifierType modifier,
+ gpointer user_data) {
+ return reinterpret_cast<InfoBubbleGtk*>(user_data)->OnEscape();
}
- gboolean HandleEscape();
-
- static gboolean HandleExposeThunk(GtkWidget* widget,
- GdkEventExpose* event,
- gpointer user_data) {
- return reinterpret_cast<InfoBubbleGtk*>(user_data)->HandleExpose();
- }
- gboolean HandleExpose();
-
- static void HandleSizeAllocateThunk(GtkWidget* widget,
- GtkAllocation* allocation,
- gpointer user_data) {
- reinterpret_cast<InfoBubbleGtk*>(user_data)->HandleSizeAllocate();
- }
- void HandleSizeAllocate();
-
- static gboolean HandleButtonPressThunk(GtkWidget* widget,
- GdkEventButton* event,
- gpointer user_data) {
- return reinterpret_cast<InfoBubbleGtk*>(user_data)->
- HandleButtonPress(event);
- }
- gboolean HandleButtonPress(GdkEventButton* event);
-
- static gboolean HandleButtonReleaseThunk(GtkWidget* widget,
- GdkEventButton* event,
- gpointer user_data) {
- return reinterpret_cast<InfoBubbleGtk*>(user_data)->
- HandleButtonRelease(event);
- }
- gboolean HandleButtonRelease(GdkEventButton* event);
-
- static gboolean HandleDestroyThunk(GtkWidget* widget,
- gpointer user_data) {
- return reinterpret_cast<InfoBubbleGtk*>(user_data)->HandleDestroy();
- }
- gboolean HandleDestroy();
-
- static gboolean HandleToplevelConfigureThunk(GtkWidget* widget,
- GdkEventConfigure* event,
- gpointer user_data) {
- return reinterpret_cast<InfoBubbleGtk*>(user_data)->
- HandleToplevelConfigure(event);
- }
- gboolean HandleToplevelConfigure(GdkEventConfigure* event);
-
- static gboolean HandleToplevelUnmapThunk(GtkWidget* widget,
- GdkEvent* event,
- gpointer user_data) {
- return reinterpret_cast<InfoBubbleGtk*>(user_data)->HandleToplevelUnmap();
- }
- gboolean HandleToplevelUnmap();
+ gboolean OnEscape();
+
+ CHROMEGTK_CALLBACK_1(InfoBubbleGtk, gboolean, OnExpose, GdkEventExpose*);
+ CHROMEGTK_CALLBACK_1(InfoBubbleGtk, void, OnSizeAllocate, GtkAllocation*);
+ CHROMEGTK_CALLBACK_1(InfoBubbleGtk, gboolean, OnButtonPress, GdkEventButton*);
+ CHROMEGTK_CALLBACK_0(InfoBubbleGtk, gboolean, OnDestroy);
+ CHROMEGTK_CALLBACK_0(InfoBubbleGtk, void, OnHide);
+ CHROMEGTK_CALLBACK_1(InfoBubbleGtk, gboolean, OnToplevelConfigure,
+ GdkEventConfigure*);
+ CHROMEGTK_CALLBACK_1(InfoBubbleGtk, gboolean, OnToplevelUnmap, GdkEvent*);
// The caller supplied delegate, can be NULL.
InfoBubbleGtkDelegate* delegate_;