]> khamidou — GitHub mirrors - electron.git/commitdiff
linux: Use native frame for message box.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 24 Jul 2014 13:06:33 +0000 (21:06 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 24 Jul 2014 13:06:33 +0000 (21:06 +0800)
atom/browser/ui/message_box_views.cc

index de736216df7ceef81c2d98380ed95832bf34f853..c050a3dd3c39a2ec67b69a0b6644ef968ba81de7 100644 (file)
 #include "ui/views/widget/widget_delegate.h"
 #include "ui/wm/core/shadow_types.h"
 
+#if defined(USE_X11)
+#include "ui/views/window/native_frame_view.h"
+#endif
+
 namespace atom {
 
 namespace {
@@ -164,11 +168,6 @@ MessageDialog::MessageDialog(NativeWindow* parent_window,
     params.remove_standard_frame = true;
   }
 
-#if defined(USE_X11)
-  // In X11 the window frame is drawn by the application.
-  params.remove_standard_frame = true;
-#endif
-
   widget_.reset(new views::Widget);
   widget_->Init(params);
 
@@ -242,8 +241,13 @@ ui::ModalType MessageDialog::GetModalType() const {
 
 views::NonClientFrameView* MessageDialog::CreateNonClientFrameView(
     views::Widget* widget) {
-  if (!parent_)
+  if (!parent_) {
+#if defined(USE_X11)
+    return new views::NativeFrameView(widget);
+#else
     return NULL;
+#endif
+  }
 
   // Create a bubble style frame like Chrome.
   views::BubbleFrameView* frame =  new views::BubbleFrameView(gfx::Insets());