diff options
Diffstat (limited to 'ui/views/widget/desktop_aura')
7 files changed, 42 insertions, 0 deletions
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index a2ab44c..529e8ca 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc @@ -696,6 +696,11 @@ ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { return DesktopRootWindowHost::GetNativeTheme(window_); } +void DesktopNativeWidgetAura::OnRootViewLayout() const { + if (window_) + desktop_root_window_host_->OnRootViewLayout(); +} + //////////////////////////////////////////////////////////////////////////////// // DesktopNativeWidgetAura, aura::WindowDelegate implementation: diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h index da45e2d..6b29d0c 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h @@ -160,6 +160,7 @@ class VIEWS_EXPORT DesktopNativeWidgetAura virtual void EndMoveLoop() OVERRIDE; virtual void SetVisibilityChangedAnimationsEnabled(bool value) OVERRIDE; virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; + virtual void OnRootViewLayout() const OVERRIDE; // Overridden from aura::WindowDelegate: virtual gfx::Size GetMinimumSize() const OVERRIDE; diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host.h b/ui/views/widget/desktop_aura/desktop_root_window_host.h index 9bdc946..583b0ac 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host.h +++ b/ui/views/widget/desktop_aura/desktop_root_window_host.h @@ -109,6 +109,8 @@ class VIEWS_EXPORT DesktopRootWindowHost { virtual void FlashFrame(bool flash_frame) = 0; + virtual void OnRootViewLayout() const = 0; + // Called when the DesktopNativeWidgetAura's aura::Window is focused and // blurred. virtual void OnNativeWidgetFocus() = 0; diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc index 3467fea..b9915ba 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc @@ -365,6 +365,9 @@ void DesktopRootWindowHostWin::FlashFrame(bool flash_frame) { message_handler_->FlashFrame(flash_frame); } +void DesktopRootWindowHostWin::OnRootViewLayout() const { +} + void DesktopRootWindowHostWin::OnNativeWidgetFocus() { // HWNDMessageHandler will perform the proper updating on its own. } diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.h b/ui/views/widget/desktop_aura/desktop_root_window_host_win.h index 0428243..3e11208 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.h +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.h @@ -92,6 +92,7 @@ class VIEWS_EXPORT DesktopRootWindowHostWin const gfx::ImageSkia& app_icon) OVERRIDE; virtual void InitModalType(ui::ModalType modal_type) OVERRIDE; virtual void FlashFrame(bool flash_frame) OVERRIDE; + virtual void OnRootViewLayout() const OVERRIDE; virtual void OnNativeWidgetFocus() OVERRIDE; virtual void OnNativeWidgetBlur() OVERRIDE; diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc index acb84ff..3718f9b 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc @@ -521,6 +521,35 @@ void DesktopRootWindowHostX11::FlashFrame(bool flash_frame) { NOTIMPLEMENTED(); } +void DesktopRootWindowHostX11::OnRootViewLayout() const { + if (!window_mapped_) + return; + + XSizeHints hints; + long supplied_return; + XGetWMNormalHints(xdisplay_, xwindow_, &hints, &supplied_return); + + gfx::Size minimum = native_widget_delegate_->GetMinimumSize(); + if (minimum.IsEmpty()) { + hints.flags &= ~PMinSize; + } else { + hints.flags |= PMinSize; + hints.min_width = minimum.width(); + hints.min_height = minimum.height(); + } + + gfx::Size maximum = native_widget_delegate_->GetMaximumSize(); + if (maximum.IsEmpty()) { + hints.flags &= ~PMaxSize; + } else { + hints.flags |= PMaxSize; + hints.max_width = maximum.width(); + hints.max_height = maximum.height(); + } + + XSetWMNormalHints(xdisplay_, xwindow_, &hints); +} + void DesktopRootWindowHostX11::OnNativeWidgetFocus() { native_widget_delegate_->AsWidget()->GetInputMethod()->OnFocus(); } diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.h b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.h index 526bee4..a3623de 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.h +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.h @@ -119,6 +119,7 @@ class VIEWS_EXPORT DesktopRootWindowHostX11 : const gfx::ImageSkia& app_icon) OVERRIDE; virtual void InitModalType(ui::ModalType modal_type) OVERRIDE; virtual void FlashFrame(bool flash_frame) OVERRIDE; + virtual void OnRootViewLayout() const OVERRIDE; virtual void OnNativeWidgetFocus() OVERRIDE; virtual void OnNativeWidgetBlur() OVERRIDE; |