Chromium Code Reviews| Index: chrome/browser/gtk/browser_actions_toolbar_gtk.cc |
| diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc |
| index b1126bc8e9f81672ef5099466568d3859820abc0..b60489a06ff88649a230e1d1a5ba0bfc660375cc 100644 |
| --- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc |
| +++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc |
| @@ -350,6 +350,7 @@ BrowserActionsToolbarGtk::BrowserActionsToolbarGtk(Browser* browser) |
| resize_animation_(this), |
| desired_width_(0), |
| start_width_(0), |
| + draw_gripper_(false), |
| method_factory_(this) { |
| ExtensionsService* extension_service = profile_->GetExtensionsService(); |
| // The |extension_service| can be NULL in Incognito. |
| @@ -753,6 +754,9 @@ gboolean BrowserActionsToolbarGtk::OnGripperMotionNotify( |
| gboolean BrowserActionsToolbarGtk::OnGripperExpose(GtkWidget* gripper, |
| GdkEventExpose* expose) { |
| + if (!draw_gripper_) |
| + return TRUE; |
| + |
| cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(expose->window)); |
| CairoCachedSurface* surface = theme_provider_->GetSurfaceNamed( |
| @@ -777,13 +781,18 @@ gboolean BrowserActionsToolbarGtk::OnGripperEnterNotify( |
| GtkWidget* gripper, GdkEventCrossing* event) { |
| gdk_window_set_cursor(gripper->window, |
| gtk_util::GetCursor(GDK_SB_H_DOUBLE_ARROW)); |
| + draw_gripper_ = true; |
|
sky
2010/07/01 16:40:14
How come you don't queue_draw here and @ 793?
Evan Stade
2010/07/01 17:35:08
GtkButtons already queue_draw when the mouse enter
|
| + |
| return FALSE; |
| } |
| gboolean BrowserActionsToolbarGtk::OnGripperLeaveNotify( |
| GtkWidget* gripper, GdkEventCrossing* event) { |
| - if (!(event->state & GDK_BUTTON1_MASK)) |
| + if (!(event->state & GDK_BUTTON1_MASK)) { |
| gdk_window_set_cursor(gripper->window, NULL); |
| + draw_gripper_ = false; |
| + } |
| + |
| return FALSE; |
| } |
| @@ -792,8 +801,11 @@ gboolean BrowserActionsToolbarGtk::OnGripperButtonRelease( |
| gfx::Rect gripper_rect(0, 0, |
| gripper->allocation.width, gripper->allocation.height); |
| gfx::Point release_point(event->x, event->y); |
| - if (!gripper_rect.Contains(release_point)) |
| + if (!gripper_rect.Contains(release_point)) { |
| gdk_window_set_cursor(gripper->window, NULL); |
| + draw_gripper_ = false; |
| + gtk_widget_queue_draw(gripper); |
| + } |
| // After the user resizes the toolbar, we want to smartly resize it to be |
| // the perfect size to fit the buttons. |