]> khamidou — GitHub mirrors - electron.git/commitdiff
window: use _NET_WM_STATE_FULLSCREEN before window is mapped
authorRobo <hop2deep@gmail.com>
Mon, 29 Jun 2015 13:53:33 +0000 (19:23 +0530)
committerRobo <hop2deep@gmail.com>
Mon, 29 Jun 2015 14:14:56 +0000 (19:44 +0530)
atom/browser/native_window.cc
atom/browser/native_window_views.cc

index b5753c8bca6fe6cb42ac2301a8a7186d2d362e05..a1c839679c08fe956b680d95567166053489e72a 100644 (file)
@@ -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);
index 96997222e27e1c621c6bf397118024d75fe8eb82..86e9efc2c2f896e9a672117839a0cb3cc0a0ecb9 100644 (file)
@@ -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))