diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 339feb52c134..ed63d524a124 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -224,6 +224,9 @@ NativeWindowViews::NativeWindowViews( bool fullscreen = false; options.Get(options::kFullscreen, &fullscreen); + std::string window_type; + options.Get(options::kType, &window_type); + #if defined(USE_X11) // Start monitoring window states. window_state_watcher_.reset(new WindowStateWatcher(this)); @@ -253,9 +256,6 @@ NativeWindowViews::NativeWindowViews( state_atom_list.push_back(GetAtom("_NET_WM_STATE_FULLSCREEN")); } - std::string window_type; - options.Get(options::kType, &window_type); - if (parent) { SetParentWindow(parent); // Force using dialog type for child window. @@ -295,12 +295,13 @@ NativeWindowViews::NativeWindowViews( ::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style); } - if (!thick_frame_) { - // Window without thick frame has to have WS_EX_COMPOSITED style. - LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE); + LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE); + // Window without thick frame has to have WS_EX_COMPOSITED style. + if (!thick_frame_) ex_style |= WS_EX_COMPOSITED; - ::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style); - } + if (window_type == "toolbar") + ex_style |= WS_EX_TOOLWINDOW; + ::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style); #endif // TODO(zcbenz): This was used to force using native frame on Windows 2003, we diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 3d48b30010ed..47b403c7a55e 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -197,6 +197,7 @@ supported values are: (`kCGDesktopWindowLevel - 1`). Note that desktop window will not receive focus, keyboard or mouse events, but you can use `globalShortcut` to receive input sparingly. +* On Windows, possible types are `toolbar`, The `titleBarStyle` option is only supported on macOS 10.10 Yosemite and newer. Possible values are: