:penguin: :bug: Move the workaround to `lib/browser/init.js`
authorMenci <HuangHaoRui301@Gmail.com>
Tue, 27 Sep 2016 11:19:52 +0000 (19:19 +0800)
committerMenci <HuangHaoRui301@Gmail.com>
Tue, 27 Sep 2016 11:19:52 +0000 (19:19 +0800)
lib/browser/init.js
lib/common/init.js

index fb1688d..667a7ef 100644 (file)
@@ -162,5 +162,10 @@ require('./api/protocol')
 // Set main startup script of the app.
 const mainStartupScript = packageJson.main || 'index.js'
 
+// Workaround for electron/electron#5050
+if (process.platform === 'linux' && process.env.XDG_CURRENT_DESKTOP === 'Pantheon') {
+  process.env.XDG_CURRENT_DESKTOP = 'Unity';
+}
+
 // Finally load app's main.js and transfer control to C++.
 Module._load(path.join(packagePath, mainStartupScript), Module, true)
index 0c2ac80..b82102c 100644 (file)
@@ -58,8 +58,3 @@ if (process.platform === 'win32') {
     process.windowsStore = true
   }
 }
-
-// Workaround for electron/electron#5050
-if (process.platform === 'linux' && process.env.XDG_CURRENT_DESKTOP === 'Pantheon') {
-  process.env.XDG_CURRENT_DESKTOP = 'Unity';
-}