| 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 "ui/views/widget/native_widget_gtk.h" | 5 #include "ui/views/widget/native_widget_gtk.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/extensions/shape.h> | 9 #include <X11/extensions/shape.h> |
| 10 #include <gdk/gdk.h> | 10 #include <gdk/gdk.h> |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 // Make container here. | 666 // Make container here. |
| 667 CreateGtkWidget(modified_params); | 667 CreateGtkWidget(modified_params); |
| 668 | 668 |
| 669 if (params.type == Widget::InitParams::TYPE_MENU) { | 669 if (params.type == Widget::InitParams::TYPE_MENU) { |
| 670 gtk_window_set_destroy_with_parent(GTK_WINDOW(GetNativeView()), TRUE); | 670 gtk_window_set_destroy_with_parent(GTK_WINDOW(GetNativeView()), TRUE); |
| 671 gtk_window_set_type_hint(GTK_WINDOW(GetNativeView()), | 671 gtk_window_set_type_hint(GTK_WINDOW(GetNativeView()), |
| 672 GDK_WINDOW_TYPE_HINT_MENU); | 672 GDK_WINDOW_TYPE_HINT_MENU); |
| 673 } | 673 } |
| 674 | 674 |
| 675 if (View::get_use_acceleration_when_possible()) { | 675 if (View::get_use_acceleration_when_possible()) { |
| 676 if (ui::Compositor::compositor_factory()) { | 676 gint width, height; |
| 677 compositor_ = (*ui::Compositor::compositor_factory())(this); | 677 gdk_drawable_get_size(window_contents_->window, &width, &height); |
| 678 } else { | 678 compositor_ = ui::Compositor::Create(this, |
| 679 gint width, height; | 679 GDK_WINDOW_XID(window_contents_->window), |
| 680 gdk_drawable_get_size(window_contents_->window, &width, &height); | 680 gfx::Size(width, height)); |
| 681 compositor_ = ui::Compositor::Create(this, | |
| 682 GDK_WINDOW_XID(window_contents_->window), | |
| 683 gfx::Size(width, height)); | |
| 684 } | |
| 685 if (compositor_.get()) { | 681 if (compositor_.get()) { |
| 686 View* root_view = delegate_->AsWidget()->GetRootView(); | 682 View* root_view = delegate_->AsWidget()->GetRootView(); |
| 687 root_view->SetPaintToLayer(true); | 683 root_view->SetPaintToLayer(true); |
| 688 compositor_->SetRootLayer(root_view->layer()); | 684 compositor_->SetRootLayer(root_view->layer()); |
| 689 root_view->SetFillsBoundsOpaquely(!transparent_); | 685 root_view->SetFillsBoundsOpaquely(!transparent_); |
| 690 } | 686 } |
| 691 } | 687 } |
| 692 | 688 |
| 693 delegate_->OnNativeWidgetCreated(); | 689 delegate_->OnNativeWidgetCreated(); |
| 694 | 690 |
| (...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 button_pressed = event->type == GDK_BUTTON_PRESS || | 2217 button_pressed = event->type == GDK_BUTTON_PRESS || |
| 2222 event->type == GDK_2BUTTON_PRESS || | 2218 event->type == GDK_2BUTTON_PRESS || |
| 2223 event->type == GDK_3BUTTON_PRESS; | 2219 event->type == GDK_3BUTTON_PRESS; |
| 2224 gdk_event_free(event); | 2220 gdk_event_free(event); |
| 2225 } | 2221 } |
| 2226 return button_pressed; | 2222 return button_pressed; |
| 2227 } | 2223 } |
| 2228 | 2224 |
| 2229 } // namespace internal | 2225 } // namespace internal |
| 2230 } // namespace views | 2226 } // namespace views |
| OLD | NEW |