diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 42a74286f22b..4ee6d8f9507f 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -606,14 +606,11 @@ void NativeWindowViews::SetContentSizeConstraints( // this to determine whether native widget has initialized. if (widget() && widget()->widget_delegate()) widget()->OnSizeConstraintsChanged(); -#if defined(OS_WIN) || defined(USE_X11) if (resizable_) old_size_constraints_ = size_constraints; -#endif } void NativeWindowViews::SetResizable(bool resizable) { -#if defined(OS_WIN) || defined(USE_X11) if (resizable != resizable_) { // On Linux there is no "resizable" property of a window, we have to set // both the minimum and maximum size to the window size to achieve it. @@ -627,7 +624,6 @@ void NativeWindowViews::SetResizable(bool resizable) { extensions::SizeConstraints(content_size, content_size)); } } -#endif #if defined(OS_WIN) if (has_frame() && thick_frame_) FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME); @@ -650,11 +646,8 @@ bool NativeWindowViews::IsResizable() { #if defined(OS_WIN) if (has_frame()) return ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME; - else - return CanResize(); -#else - return CanResize(); #endif + return CanResize(); } void NativeWindowViews::SetMovable(bool movable) { diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index 691748e71fff..e91cae21bad7 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -215,6 +215,12 @@ class NativeWindowViews : public NativeWindow, bool menu_bar_visible_; bool menu_bar_alt_pressed_; + // The "resizable" flag on Linux is implemented by setting size constraints, + // we need to make sure size constraints are restored when window becomes + // resizable again. This is also used on Windows, to keep taskbar resize + // events from resizing the window. + extensions::SizeConstraints old_size_constraints_; + #if defined(USE_X11) std::unique_ptr global_menu_bar_; @@ -224,13 +230,7 @@ class NativeWindowViews : public NativeWindow, // To disable the mouse events. std::unique_ptr event_disabler_; #endif -#if defined(OS_WIN) || defined(USE_X11) - // The "resizable" flag on Linux is implemented by setting size constraints, - // we need to make sure size constraints are restored when window becomes - // resizable again. This is also used on Windows, to keep taskbar resize - // events from resizing the window. - extensions::SizeConstraints old_size_constraints_; -#endif + #if defined(OS_WIN) // Weak ref. AtomDesktopWindowTreeHostWin* atom_desktop_window_tree_host_win_;