| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/widget/widget_gtk.h" | 5 #include "views/widget/widget_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
| 9 #include <X11/extensions/shape.h> | 9 #include <X11/extensions/shape.h> |
| 10 | 10 |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 // reset the shape in this method regardless of whether the size changed. | 889 // reset the shape in this method regardless of whether the size changed. |
| 890 gfx::Size new_size(allocation->width, allocation->height); | 890 gfx::Size new_size(allocation->width, allocation->height); |
| 891 if (new_size == size_) | 891 if (new_size == size_) |
| 892 return; | 892 return; |
| 893 size_ = new_size; | 893 size_ = new_size; |
| 894 root_view_->SetBounds(0, 0, allocation->width, allocation->height); | 894 root_view_->SetBounds(0, 0, allocation->width, allocation->height); |
| 895 root_view_->SchedulePaint(); | 895 root_view_->SchedulePaint(); |
| 896 } | 896 } |
| 897 | 897 |
| 898 gboolean WidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) { | 898 gboolean WidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) { |
| 899 if (transparent_) { | 899 if (transparent_ && type_ == TYPE_CHILD) { |
| 900 // Clear the background before drawing any view and native components. | 900 // Clear the background before drawing any view and native components. |
| 901 DrawTransparentBackground(widget, event); | 901 DrawTransparentBackground(widget, event); |
| 902 if (type_ == TYPE_CHILD && !CompositePainter::IsComposited(widget_)) { | 902 if (!CompositePainter::IsComposited(widget_)) { |
| 903 // Let the parent draw the content only after something is drawn on | 903 // Let the parent draw the content only after something is drawn on |
| 904 // the widget. | 904 // the widget. |
| 905 CompositePainter::SetComposited(widget_); | 905 CompositePainter::SetComposited(widget_); |
| 906 } | 906 } |
| 907 } | 907 } |
| 908 root_view_->OnPaint(event); | 908 root_view_->OnPaint(event); |
| 909 return false; // False indicates other widgets should get the event as well. | 909 return false; // False indicates other widgets should get the event as well. |
| 910 } | 910 } |
| 911 | 911 |
| 912 void WidgetGtk::OnDragDataGet(GtkWidget* widget, | 912 void WidgetGtk::OnDragDataGet(GtkWidget* widget, |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 GtkWindow* window = GTK_WINDOW(element->data); | 1524 GtkWindow* window = GTK_WINDOW(element->data); |
| 1525 DCHECK(window); | 1525 DCHECK(window); |
| 1526 RootView *root_view = FindRootView(window); | 1526 RootView *root_view = FindRootView(window); |
| 1527 if (root_view) | 1527 if (root_view) |
| 1528 root_view->NotifyLocaleChanged(); | 1528 root_view->NotifyLocaleChanged(); |
| 1529 } | 1529 } |
| 1530 g_list_free(window_list); | 1530 g_list_free(window_list); |
| 1531 } | 1531 } |
| 1532 | 1532 |
| 1533 } // namespace views | 1533 } // namespace views |
| OLD | NEW |