diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/aura_desktop/aura_desktop_main.cc | 3 | ||||
-rw-r--r-- | views/widget/native_widget_gtk.cc | 6 | ||||
-rw-r--r-- | views/widget/native_widget_gtk.h | 5 | ||||
-rw-r--r-- | views/widget/native_widget_win.cc | 11 | ||||
-rw-r--r-- | views/widget/native_widget_win.h | 5 |
5 files changed, 28 insertions, 2 deletions
diff --git a/views/aura_desktop/aura_desktop_main.cc b/views/aura_desktop/aura_desktop_main.cc index 3d0e4f3..93e22fa 100644 --- a/views/aura_desktop/aura_desktop_main.cc +++ b/views/aura_desktop/aura_desktop_main.cc @@ -121,6 +121,9 @@ int main(int argc, char** argv) { base::MessagePumpX::DisableGtkMessagePump(); #endif + // Create the message-loop here before creating the desktop. + MessageLoop message_loop(MessageLoop::TYPE_UI); + aura::Desktop::GetInstance(); // Create a hierarchy of test windows. diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc index 3db5d91..2d761d6 100644 --- a/views/widget/native_widget_gtk.cc +++ b/views/widget/native_widget_gtk.cc @@ -674,7 +674,7 @@ void NativeWidgetGtk::InitNativeWidget(const Widget::InitParams& params) { } else { gint width, height; gdk_drawable_get_size(window_contents_->window, &width, &height); - compositor_ = ui::Compositor::Create( + compositor_ = ui::Compositor::Create(this, GDK_WINDOW_XID(window_contents_->window), gfx::Size(width, height)); } @@ -1804,6 +1804,10 @@ void NativeWidgetGtk::HandleGtkGrabBroke() { //////////////////////////////////////////////////////////////////////////////// // NativeWidgetGtk, private: +void NativeWidgetGtk::ScheduleCompositorPaint() { + SchedulePaintInRect(gfx::Rect(gfx::Point(), size_)); +} + void NativeWidgetGtk::DispatchKeyEventPostIME(const KeyEvent& key) { // Always reset |should_handle_menu_key_release_| unless we are handling a // VKEY_MENU key release event. It ensures that VKEY_MENU accelerator can only diff --git a/views/widget/native_widget_gtk.h b/views/widget/native_widget_gtk.h index 798d035..eb5ec4a 100644 --- a/views/widget/native_widget_gtk.h +++ b/views/widget/native_widget_gtk.h @@ -12,6 +12,7 @@ #include "base/message_loop.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/x/active_window_watcher_x.h" +#include "ui/gfx/compositor/compositor.h" #include "ui/gfx/size.h" #include "views/focus/focus_manager.h" #include "views/widget/native_widget_private.h" @@ -41,6 +42,7 @@ class NativeWidgetDelegate; // Widget implementation for GTK. class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate, + public ui::CompositorDelegate, public ui::ActiveWindowWatcherX::Observer { public: explicit NativeWidgetGtk(internal::NativeWidgetDelegate* delegate); @@ -297,6 +299,9 @@ class VIEWS_EXPORT NativeWidgetGtk : public internal::NativeWidgetPrivate, class DropObserver; friend class DropObserver; + // Overridden from ui::CompositorDelegate + virtual void ScheduleCompositorPaint(); + // Overridden from internal::InputMethodDelegate virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc index 1efc0c9..074de4c 100644 --- a/views/widget/native_widget_win.cc +++ b/views/widget/native_widget_win.cc @@ -460,6 +460,15 @@ void NativeWidgetWin::PopForceHidden() { } //////////////////////////////////////////////////////////////////////////////// +// NativeWidgetWin, CompositorDelegate implementation: + +void NativeWidgetWin::ScheduleCompositorPaint() { + RECT rect; + ::GetClientRect(GetNativeView(), &rect); + InvalidateRect(GetNativeView(), &rect, FALSE); +} + +//////////////////////////////////////////////////////////////////////////////// // NativeWidgetWin, NativeWidget implementation: void NativeWidgetWin::InitNativeWidget(const Widget::InitParams& params) { @@ -1247,7 +1256,7 @@ LRESULT NativeWidgetWin::OnCreate(CREATESTRUCT* create_struct) { } else { CRect window_rect; GetClientRect(&window_rect); - compositor_ = ui::Compositor::Create( + compositor_ = ui::Compositor::Create(this, hwnd(), gfx::Size(window_rect.Width(), window_rect.Height())); } diff --git a/views/widget/native_widget_win.h b/views/widget/native_widget_win.h index 3cfa9c6..967ed85 100644 --- a/views/widget/native_widget_win.h +++ b/views/widget/native_widget_win.h @@ -21,6 +21,7 @@ #include "base/win/scoped_comptr.h" #include "base/win/win_util.h" #include "ui/base/win/window_impl.h" +#include "ui/gfx/compositor/compositor.h" #include "views/focus/focus_manager.h" #include "views/layout/layout_manager.h" #include "views/widget/native_widget_private.h" @@ -79,6 +80,7 @@ const int WM_NCUAHDRAWFRAME = 0xAF; /////////////////////////////////////////////////////////////////////////////// class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl, public MessageLoopForUI::Observer, + public ui::CompositorDelegate, public internal::NativeWidgetPrivate { public: explicit NativeWidgetWin(internal::NativeWidgetDelegate* delegate); @@ -180,6 +182,9 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl, return ::GetClientRect(GetNativeView(), rect); } + // Overridden from ui::CompositorDelegate: + virtual void ScheduleCompositorPaint(); + // Overridden from internal::NativeWidgetPrivate: virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; |