Skip to content

Commit

Permalink
Fix window blur problem on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
harshjv committed Jan 6, 2017
1 parent ea04132 commit 825662f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "donut",
"version": "2.2.0",
"version": "2.2.1-alpha.1",
"description": "Cross platform cryptocurrency tracker",
"main": "main.js",
"scripts": {
Expand Down
36 changes: 18 additions & 18 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ const { app, ipcMain } = require('electron')

const platform = os.platform()

const width = 360
const height = 600
// All platforms
const browserWindowConfig = {
icon: path.join(__dirname, 'icon.png'),
width: 360,
height: 600,
alwaysOnTop: platform === 'win32',
fullscreen: false,
fullscreenable: false,
resizable: false
}

// Menubar (For macOS and Windows)
const menuBarConfig = {
preloadWindow: true,
showDockIcon: false
}

if (platform === 'darwin' || platform === 'win32') {
const menubar = require('menubar')

const mb = menubar({
preloadWindow: true,
showDockIcon: false,
icon: path.join(__dirname, 'icon.png'),
width: width,
height: height
})

mb.on('after-create-window', () => mb.window.setResizable(false))
const mb = menubar(Object.assign(browserWindowConfig, menuBarConfig))

app.on('ready', () => {
mb.tray.setTitle('Donut')
Expand All @@ -32,13 +38,7 @@ if (platform === 'darwin' || platform === 'win32') {
const { BrowserWindow } = require('electron')

app.on('ready', () => {
let win = new BrowserWindow({
width: width,
height: height,
fullscreen: false,
fullscreenable: false,
resizable: false
})
let win = new BrowserWindow(browserWindowConfig)

win.on('closed', () => {
win = null
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Cross platform cryptocurrency tracker",
"homepage": "https://harshjv.github.io/donut/",
"license": "MIT",
"version": "2.2.0",
"version": "2.2.1-alpha.1",
"main": "main.js",
"repository": "https://github.com/harshjv/donut",
"keywords": [
Expand Down

0 comments on commit 825662f

Please sign in to comment.