From b5c5cce725af15158e9f7ab60ec118fd30a05ee7 Mon Sep 17 00:00:00 2001 From: Robo Date: Mon, 29 Jun 2015 19:23:33 +0530 Subject: [PATCH] window: use _NET_WM_STATE_FULLSCREEN before window is mapped --- atom/browser/native_window.cc | 2 ++ atom/browser/native_window_views.cc | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index b5753c8bca6..a1c839679c0 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -189,10 +189,12 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) { if (options.Get(switches::kAlwaysOnTop, &top) && top) { SetAlwaysOnTop(true); } +#if defined(OS_MACOSX) || defined(OS_WIN) bool fullscreen; if (options.Get(switches::kFullscreen, &fullscreen) && fullscreen) { SetFullScreen(true); } +#endif bool skip; if (options.Get(switches::kSkipTaskbar, &skip) && skip) { SetSkipTaskbar(skip); diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 96997222e27..86e9efc2c2f 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -285,14 +285,21 @@ NativeWindowViews::NativeWindowViews( // Before the window is mapped the SetWMSpecState can not work, so we have // to manually set the _NET_WM_STATE. + std::vector<::Atom> state_atom_list; bool skip_taskbar = false; if (options.Get(switches::kSkipTaskbar, &skip_taskbar) && skip_taskbar) { - std::vector<::Atom> state_atom_list; state_atom_list.push_back(GetAtom("_NET_WM_STATE_SKIP_TASKBAR")); - ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM", - state_atom_list); } + // Before the window is mapped, there is no SHOW_FULLSCREEN_STATE. + bool fullscreen = false; + if (options.Get(switches::kFullscreen, & fullscreen) && fullscreen) { + state_atom_list.push_back(GetAtom("_NET_WM_STATE_FULLSCREEN")); + } + + ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM", + state_atom_list); + // Set the _NET_WM_WINDOW_TYPE. std::string window_type; if (options.Get(switches::kType, &window_type))