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/native_widget_gtk.h" | 5 #include "views/widget/native_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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 GDK_WINDOW_TYPE_HINT_MENU); | 668 GDK_WINDOW_TYPE_HINT_MENU); |
669 } | 669 } |
670 | 670 |
671 if (View::get_use_acceleration_when_possible()) { | 671 if (View::get_use_acceleration_when_possible()) { |
672 if (Widget::compositor_factory()) { | 672 if (Widget::compositor_factory()) { |
673 compositor_ = (*Widget::compositor_factory())(); | 673 compositor_ = (*Widget::compositor_factory())(); |
674 } else { | 674 } else { |
675 gint width, height; | 675 gint width, height; |
676 gdk_drawable_get_size(window_contents_->window, &width, &height); | 676 gdk_drawable_get_size(window_contents_->window, &width, &height); |
677 compositor_ = ui::Compositor::Create( | 677 compositor_ = ui::Compositor::Create( |
678 GDK_WINDOW_XID(window_contents_->window), | 678 this, |
679 gfx::Size(width, height)); | 679 gfx::Size(width, height)); |
680 } | 680 } |
681 if (compositor_.get()) | 681 if (compositor_.get()) |
682 delegate_->AsWidget()->GetRootView()->SetPaintToLayer(true); | 682 delegate_->AsWidget()->GetRootView()->SetPaintToLayer(true); |
683 } | 683 } |
684 | 684 |
685 delegate_->OnNativeWidgetCreated(); | 685 delegate_->OnNativeWidgetCreated(); |
686 | 686 |
687 if (opacity_ != 255) | 687 if (opacity_ != 255) |
688 SetOpacity(opacity_); | 688 SetOpacity(opacity_); |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 button_pressed = event->type == GDK_BUTTON_PRESS || | 2249 button_pressed = event->type == GDK_BUTTON_PRESS || |
2250 event->type == GDK_2BUTTON_PRESS || | 2250 event->type == GDK_2BUTTON_PRESS || |
2251 event->type == GDK_3BUTTON_PRESS; | 2251 event->type == GDK_3BUTTON_PRESS; |
2252 gdk_event_free(event); | 2252 gdk_event_free(event); |
2253 } | 2253 } |
2254 return button_pressed; | 2254 return button_pressed; |
2255 } | 2255 } |
2256 | 2256 |
2257 } // namespace internal | 2257 } // namespace internal |
2258 } // namespace views | 2258 } // namespace views |
OLD | NEW |