From 0f5b4276488b962fc2facb2c6ea8d2faa070b9c2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 12 Jul 2014 11:45:24 +0800 Subject: [PATCH] Always shows window frame except for maximized window on Unity. --- brightray/browser/views/views_delegate.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/brightray/browser/views/views_delegate.cc b/brightray/browser/views/views_delegate.cc index 6ade87e338..8da35dea80 100644 --- a/brightray/browser/views/views_delegate.cc +++ b/brightray/browser/views/views_delegate.cc @@ -6,6 +6,10 @@ #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" +#if defined(OS_LINUX) +#include "ui/views/linux_ui/linux_ui.h" +#endif + namespace brightray { ViewsDelegate::ViewsDelegate() { @@ -95,7 +99,14 @@ base::TimeDelta ViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { } bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) { - return maximized; +#if defined(OS_LINUX) + // On Ubuntu Unity, the system always provides a title bar for maximized + // windows. + views::LinuxUI* ui = views::LinuxUI::instance(); + return maximized && ui && ui->UnityIsRunning(); +#else + return false; +#endif } } // namespace brightray