From 9e0547b98f8b7f3a572aa1cf9770f434c8fdeed9 Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Sat, 14 Jan 2017 01:13:00 -0800 Subject: [PATCH] Fix the rendering for the rounded edges --- atom/browser/native_window_views_win.cc | 12 ------------ .../ui/win/atom_desktop_window_tree_host_win.cc | 8 ++++++++ .../ui/win/atom_desktop_window_tree_host_win.h | 1 + 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/atom/browser/native_window_views_win.cc b/atom/browser/native_window_views_win.cc index 4b086c25d1691..1b523e90b8041 100644 --- a/atom/browser/native_window_views_win.cc +++ b/atom/browser/native_window_views_win.cc @@ -147,18 +147,6 @@ bool NativeWindowViews::PreHandleMSG( } return false; } - /** Return zero (no-op) for non-client area events when window is frameless. - * \see WM_NCPAINT - https://msdn.microsoft.com/en-us/library/windows/desktop/dd145212(v=vs.85).aspx - * \see WM_NCCALCSIZE - https://msdn.microsoft.com/en-us/library/windows/desktop/ms632634(v=vs.85).aspx - */ - case WM_NCPAINT: - case WM_NCCALCSIZE: { - if (!has_frame()) { - *result = 0; - return true; - } - return false; - } default: return false; } diff --git a/atom/browser/ui/win/atom_desktop_window_tree_host_win.cc b/atom/browser/ui/win/atom_desktop_window_tree_host_win.cc index 84a6d9aa3e50c..9cc2ef9e8d224 100644 --- a/atom/browser/ui/win/atom_desktop_window_tree_host_win.cc +++ b/atom/browser/ui/win/atom_desktop_window_tree_host_win.cc @@ -25,4 +25,12 @@ bool AtomDesktopWindowTreeHostWin::PreHandleMSG( return delegate_->PreHandleMSG(message, w_param, l_param, result); } +/** Override the client area inset + * Returning true forces a border of 0 for frameless windows + */ +bool AtomDesktopWindowTreeHostWin::GetClientAreaInsets( + gfx::Insets* insets) const { + return !HasFrame(); +} + } // namespace atom diff --git a/atom/browser/ui/win/atom_desktop_window_tree_host_win.h b/atom/browser/ui/win/atom_desktop_window_tree_host_win.h index 47e4cb6aed2a9..2df70547c5ba2 100644 --- a/atom/browser/ui/win/atom_desktop_window_tree_host_win.h +++ b/atom/browser/ui/win/atom_desktop_window_tree_host_win.h @@ -27,6 +27,7 @@ class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin { protected: bool PreHandleMSG( UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) override; + bool GetClientAreaInsets(gfx::Insets* insets) const override; private: MessageHandlerDelegate* delegate_; // weak ref