| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <X11/Xatom.h> | 10 #include <X11/Xatom.h> |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 // We're not active, but the force the window to be rendered as active if | 467 // We're not active, but the force the window to be rendered as active if |
| 468 // a child window is transient to us. | 468 // a child window is transient to us. |
| 469 gpointer data = NULL; | 469 gpointer data = NULL; |
| 470 gdk_window_get_user_data(active_window, &data); | 470 gdk_window_get_user_data(active_window, &data); |
| 471 GtkWidget* widget = reinterpret_cast<GtkWidget*>(data); | 471 GtkWidget* widget = reinterpret_cast<GtkWidget*>(data); |
| 472 is_active_ = | 472 is_active_ = |
| 473 (widget && GTK_IS_WINDOW(widget) && | 473 (widget && GTK_IS_WINDOW(widget) && |
| 474 gtk_window_get_transient_for(GTK_WINDOW(widget)) == GTK_WINDOW( | 474 gtk_window_get_transient_for(GTK_WINDOW(widget)) == GTK_WINDOW( |
| 475 widget_)); | 475 widget_)); |
| 476 } | 476 } |
| 477 if (was_active != IsActive()) | 477 if (was_active != IsActive()) { |
| 478 IsActiveChanged(); | 478 IsActiveChanged(); |
| 479 GetRootView()->SchedulePaint(); |
| 480 } |
| 479 } | 481 } |
| 480 | 482 |
| 481 //////////////////////////////////////////////////////////////////////////////// | 483 //////////////////////////////////////////////////////////////////////////////// |
| 482 // WidgetGtk, Widget implementation: | 484 // WidgetGtk, Widget implementation: |
| 483 | 485 |
| 484 void WidgetGtk::InitWithWidget(Widget* parent, | 486 void WidgetGtk::InitWithWidget(Widget* parent, |
| 485 const gfx::Rect& bounds) { | 487 const gfx::Rect& bounds) { |
| 486 WidgetGtk* parent_gtk = static_cast<WidgetGtk*>(parent); | 488 WidgetGtk* parent_gtk = static_cast<WidgetGtk*>(parent); |
| 487 GtkWidget* native_parent = NULL; | 489 GtkWidget* native_parent = NULL; |
| 488 if (parent != NULL) { | 490 if (parent != NULL) { |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 | 1694 |
| 1693 NativeWidget* native_widget = GetNativeWidgetForNativeView(native_view); | 1695 NativeWidget* native_widget = GetNativeWidgetForNativeView(native_view); |
| 1694 if (native_widget) | 1696 if (native_widget) |
| 1695 children->insert(native_widget); | 1697 children->insert(native_widget); |
| 1696 gtk_container_foreach(GTK_CONTAINER(native_view), | 1698 gtk_container_foreach(GTK_CONTAINER(native_view), |
| 1697 EnumerateChildWidgetsForNativeWidgets, | 1699 EnumerateChildWidgetsForNativeWidgets, |
| 1698 reinterpret_cast<gpointer>(children)); | 1700 reinterpret_cast<gpointer>(children)); |
| 1699 } | 1701 } |
| 1700 | 1702 |
| 1701 } // namespace views | 1703 } // namespace views |
| OLD | NEW |