| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
| 10 #include "app/gfx/canvas_paint.h" | 10 #include "app/gfx/canvas_paint.h" |
| (...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1779 if (gdk_region_empty(event->region)) | 1779 if (gdk_region_empty(event->region)) |
| 1780 return TRUE; | 1780 return TRUE; |
| 1781 | 1781 |
| 1782 // If we're only repainting favicons, optimize the paint path and only draw | 1782 // If we're only repainting favicons, optimize the paint path and only draw |
| 1783 // the favicons. | 1783 // the favicons. |
| 1784 GdkRectangle* rects; | 1784 GdkRectangle* rects; |
| 1785 gint num_rects; | 1785 gint num_rects; |
| 1786 gdk_region_get_rectangles(event->region, &rects, &num_rects); | 1786 gdk_region_get_rectangles(event->region, &rects, &num_rects); |
| 1787 qsort(rects, num_rects, sizeof(GdkRectangle), CompareGdkRectangles); | 1787 qsort(rects, num_rects, sizeof(GdkRectangle), CompareGdkRectangles); |
| 1788 std::vector<int> tabs_to_repaint; | 1788 std::vector<int> tabs_to_repaint; |
| 1789 if (tabstrip->CanPaintOnlyFavIcons(rects, num_rects, &tabs_to_repaint)) { | 1789 if (!tabstrip->IsDragSessionActive() && |
| 1790 tabstrip->CanPaintOnlyFavIcons(rects, num_rects, &tabs_to_repaint)) { |
| 1790 tabstrip->PaintOnlyFavIcons(event, tabs_to_repaint); | 1791 tabstrip->PaintOnlyFavIcons(event, tabs_to_repaint); |
| 1791 g_free(rects); | 1792 g_free(rects); |
| 1792 return TRUE; | 1793 return TRUE; |
| 1793 } | 1794 } |
| 1794 g_free(rects); | 1795 g_free(rects); |
| 1795 | 1796 |
| 1796 // TODO(jhawkins): Ideally we'd like to only draw what's needed in the damage | 1797 // TODO(jhawkins): Ideally we'd like to only draw what's needed in the damage |
| 1797 // rect, but the tab widgets overlap each other, and painting on one widget | 1798 // rect, but the tab widgets overlap each other, and painting on one widget |
| 1798 // will cause an expose-event to be sent to the widgets underneath. The | 1799 // will cause an expose-event to be sent to the widgets underneath. The |
| 1799 // underlying widget does not need to be redrawn as we control the order of | 1800 // underlying widget does not need to be redrawn as we control the order of |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 | 2012 |
| 2012 // Let the middle mouse button initiate clicks as well. | 2013 // Let the middle mouse button initiate clicks as well. |
| 2013 gtk_util::SetButtonTriggersNavigation(button->widget()); | 2014 gtk_util::SetButtonTriggersNavigation(button->widget()); |
| 2014 g_signal_connect(G_OBJECT(button->widget()), "clicked", | 2015 g_signal_connect(G_OBJECT(button->widget()), "clicked", |
| 2015 G_CALLBACK(OnNewTabClicked), this); | 2016 G_CALLBACK(OnNewTabClicked), this); |
| 2016 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 2017 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); |
| 2017 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 2018 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
| 2018 | 2019 |
| 2019 return button; | 2020 return button; |
| 2020 } | 2021 } |
| OLD | NEW |