]> khamidou — GitHub mirrors - electron.git/commitdiff
views: Make frameless window work.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 7 Jul 2014 08:10:34 +0000 (16:10 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 7 Jul 2014 14:40:23 +0000 (22:40 +0800)
atom/browser/native_window_views.cc
atom/browser/ui/views/linux_frame_view.cc
filename_rules.gypi

index 04b92145a8cdef028ecb00e8d269391e895b1ae1..d26a3c929b63377b9192c23ac56855dc8d561afc 100644 (file)
@@ -62,8 +62,7 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
   views::Widget::InitParams params;
   params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
   params.delegate = this;
-  params.type = has_frame_ ? views::Widget::InitParams::TYPE_WINDOW :
-                             views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
+  params.type = views::Widget::InitParams::TYPE_WINDOW;
   params.top_level = true;
   params.remove_standard_frame = true;
   window_->Init(params);
index 5d9945ea30a3e12d98c5c6217b9f0e7f3de72126..3d31f5feaa4382433f6c902f89463f27b90c1968 100644 (file)
@@ -140,6 +140,12 @@ int LinuxFrameView::NonClientHitTest(const gfx::Point& point) {
   if (!bounds().Contains(point))
     return HTNOWHERE;
 
+  // Check for possible draggable region in the client area for the frameless
+  // window.
+  SkRegion* draggable_region = window_->draggable_region();
+  if (draggable_region && draggable_region->contains(point.x(), point.y()))
+    return HTCAPTION;
+
   int frame_component = frame_->client_view()->NonClientHitTest(point);
 
   // See if we're in the sysmenu region.  (We check the ClientView first to be
@@ -323,6 +329,9 @@ gfx::Rect LinuxFrameView::IconBounds() const {
 }
 
 bool LinuxFrameView::ShouldShowTitleBarAndBorder() const {
+  if (!window_->has_frame())
+    return false;
+
   if (frame_->IsFullscreen())
     return false;
 
index b2484cd98c07f0e05bb861eb2f5149f8b60b989f..48bccd86764e020ecba981b97bb002db1bd64d61 100644 (file)
@@ -32,7 +32,7 @@
     ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', {
       'sources/': [
         ['exclude', '_linux(_unittest)?\\.(h|cc)$'],
-        ['exclude', '(^|/)linux/'],
+        ['exclude', '(^|/)linux_[^/]*\\.(h|cc)$'],
         ['exclude', '(^|/)linux/'],
       ],
     }],