Skip to content

Commit eae620f

Browse files
committed
Fix nwjs#1021: maximize frameless window in windows 8
1 parent 324ebf1 commit eae620f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/browser/native_window_aura.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@ NativeWindowAura::NativeWindowAura(const base::WeakPtr<content::Shell>& shell,
296296

297297
window_->Init(params);
298298

299+
// WS_CAPTION is needed or the size will be miscalculated on maximizing
300+
// see upstream issue #224924
301+
#if defined(OS_WIN)
302+
HWND hwnd = views::HWNDForWidget(window_->GetTopLevelWidget());
303+
int current_style = ::GetWindowLong(hwnd, GWL_STYLE);
304+
::SetWindowLong(hwnd, GWL_STYLE, current_style | WS_CAPTION);
305+
#endif
306+
299307
if (!has_frame())
300308
InstallEasyResizeTargeterOnContainer();
301309

0 commit comments

Comments
 (0)