summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 22:39:56 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 22:39:56 +0000
commit64211b72abe79e98bfa4ca1702e9d438f3ac9208 (patch)
tree48252825e62e2d79ce17648cc22a64578e239634 /chrome
parent9c00f00af8403072573aa4b80c51a055162683f6 (diff)
downloadchromium_src-64211b72abe79e98bfa4ca1702e9d438f3ac9208.zip
chromium_src-64211b72abe79e98bfa4ca1702e9d438f3ac9208.tar.gz
chromium_src-64211b72abe79e98bfa4ca1702e9d438f3ac9208.tar.bz2
GTK: hack around floating bookmark bar stuck-in-prelight bug.
BUG=26299 Review URL: http://codereview.chromium.org/363022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index e8a475c..a544a9b 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -103,6 +103,12 @@ void SetToolBarStyle() {
"widget \"*chrome-bookmark-toolbar\" style \"chrome-bookmark-toolbar\"");
}
+void GtkToolItemSetChildState(GtkWidget* widget, gpointer userdata) {
+ GtkStateType* state = reinterpret_cast<GtkStateType*>(userdata);
+ GtkWidget* button = gtk_bin_get_child(GTK_BIN(widget));
+ gtk_widget_set_state(button, *state);
+}
+
} // namespace
const int BookmarkBarGtk::kBookmarkBarNTPHeight = 57;
@@ -603,6 +609,18 @@ void BookmarkBarGtk::UpdateFloatingState() {
// |window_| can be NULL during testing.
if (window_) {
window_->BookmarkBarIsFloating(floating_);
+
+ // If the bookmark bar is floating, then clicking a button on it will
+ // (almost certainly) cause it to stop floating. When this happens, it
+ // never gets a leave-notify event, so the button gets stuck in the prelight
+ // state. This hacks around that.
+ // http://crbug.com/26299
+ if (!floating_) {
+ GtkStateType state = GTK_STATE_NORMAL;
+ gtk_container_foreach(GTK_CONTAINER(bookmark_toolbar_.get()),
+ GtkToolItemSetChildState, &state);
+ }
+
// Listen for parent size allocations.
if (floating_ && widget()->parent) {
// Only connect once.