]> khamidou — GitHub mirrors - electron.git/commitdiff
linux: Enable force showing menubar
authorCheng Zhao <zcbenz@gmail.com>
Sun, 4 Oct 2015 08:33:03 +0000 (16:33 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 4 Oct 2015 08:33:03 +0000 (16:33 +0800)
This is for debugging purpose.

atom/browser/ui/x/x_window_utils.cc

index e57122839cd81d4a88cad465acd929d9304cd282..f5c3f54ec123e520893bbe662e95a9fa763e1b11 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <X11/Xatom.h>
 
+#include "base/environment.h"
 #include "base/strings/string_util.h"
 #include "dbus/bus.h"
 #include "dbus/object_proxy.h"
@@ -50,6 +51,10 @@ void SetWindowType(::Window xwindow, const std::string& type) {
 }
 
 bool ShouldUseGlobalMenuBar() {
+  scoped_ptr<base::Environment> env(base::Environment::Create());
+  if (env->HasVar("ELECTRON_FORCE_WINDOW_MENU_BAR"))
+    return false;
+
   dbus::Bus::Options options;
   scoped_refptr<dbus::Bus> bus(new dbus::Bus(options));