Skip to content

Commit

Permalink
v7.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sidneys committed Jun 15, 2018
1 parent e37a3b5 commit 98d6a4e
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 63 deletions.
15 changes: 14 additions & 1 deletion RELEASENOTES.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"7.6.0": {
"💎 improvements": [
"Various stability and performance improvements"
],
"🚨 fixes": [
"Hotfix for upstream `Electron v2.0.2` issue (https://github.com/sidneys/pb-for-desktop/issues/85)",
"Fixes for application updater error (https://github.com/sidneys/pb-for-desktop/issues/86)"
],
"👷 internals": [
"Upgrades `node_modules`",
"Upgrades `services`"
]
},
"7.4.0": {
"🍾 features": [
"Enables GPU hardware acceleration"
Expand Down Expand Up @@ -547,4 +560,4 @@
"Build system upgrade"
]
}
}
}
27 changes: 24 additions & 3 deletions app/scripts/main/components/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Node
* @constant
*/
const events = require('events')
const path = require('path')

/**
Expand Down Expand Up @@ -45,16 +46,23 @@ appRootPath.setPath(path.join(__dirname, '..', '..', '..', '..'))
const globals = require(path.join(appRootPath['path'], 'app', 'scripts', 'main', 'components', 'globals'))
/* eslint-enable */


/**
* Hotfix
* @see {@link https://stackoverflow.com/questions/9768444/possible-eventemitter-memory-leak-detected}
*/
events.EventEmitter.defaultMaxListeners = Infinity

/**
* Hotfix: Windows
* Hotfix (Windows)
* @see {@link https://github.com/electron/electron/issues/10864}
*/
if (platformTools.isWindows) {
app.setAppUserModelId(global.manifest.appId)
}

/**
* Hotfix: Linux
* Hotfix (Linux)
* @see {@link https://github.com/electron/electron/issues/10427}
*/
if (platformTools.isLinux) {
Expand All @@ -63,6 +71,7 @@ if (platformTools.isLinux) {
}
}


/**
* Modules
* Internal
Expand All @@ -86,6 +95,15 @@ app.on('before-quit', () => {
global.state.isQuitting = true
})

/**
* @listens Electron.App#before-quit-for-update
*/
app.on('before-quit-for-update', () => {
logger.debug('app#before-quit-for-update')

global.state.isQuitting = true
})

/**
* @listens Electron.App#ready
*/
Expand All @@ -108,11 +126,14 @@ const isSecondInstance = app.makeSingleInstance(() => {
})
})

/**
* Quit additional instances
*/
if (isSecondInstance) {
logger.debug('isSecondInstance', 'secondary instance')

logger.warn('Multiple application instances detected', app.getPath('exe'))
logger.warn('Multiple application instances detected', 'Shutting down secondary application instances')

process.exit(0)
app.quit()
}
50 changes: 20 additions & 30 deletions app/scripts/main/managers/configuration-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,9 @@ const appRootPath = require('app-root-path')['path']
const Appdirectory = require('appdirectory')
const AutoLaunch = require('auto-launch')
const electronSettings = require('electron-settings')

/**
* Modules
* Internal
* @constant
*/
const logger = require('@sidneys/logger')({ write: true })
const platformTools = require('@sidneys/platform-tools')
const electronUpdaterService = require('@sidneys/electron-updater-service')


/**
Expand All @@ -44,7 +39,6 @@ const platformTools = require('@sidneys/platform-tools')
* @default
*/
const appName = global.manifest.name
const appCurrentVersion = global.manifest.version

/**
* Filesystem
Expand Down Expand Up @@ -128,6 +122,8 @@ let configurationItems = {
default: false,
init() {
logger.debug(this.keypath, 'init')

this.implement(this.get())
},
get() {
logger.debug(this.keypath, 'get')
Expand All @@ -137,7 +133,17 @@ let configurationItems = {
set(value) {
logger.debug(this.keypath, 'set')

this.implement(value)
electronSettings.set(this.keypath, value)
},
implement(value) {
logger.debug(this.keypath, 'implement', value)

if (!!value) {
electronUpdaterService.enable()
} else {
electronUpdaterService.disable()
}
}
},
/**
Expand All @@ -160,26 +166,6 @@ let configurationItems = {
electronSettings.set(this.keypath, value)
}
},
/**
* appLastVersion
*/
appLastVersion: {
keypath: 'appLastVersion',
default: appCurrentVersion,
init() {
logger.debug(this.keypath, 'init')
},
get() {
logger.debug(this.keypath, 'get')

return electronSettings.get(this.keypath)
},
set(value) {
logger.debug(this.keypath, 'set')

electronSettings.set(this.keypath, value)
}
},
/**
* appLaunchOnStartup
*/
Expand All @@ -205,7 +191,7 @@ let configurationItems = {
implement(value) {
logger.debug(this.keypath, 'implement', value)

if (value) {
if (!!value) {
autoLauncher.enable()
} else {
autoLauncher.disable()
Expand Down Expand Up @@ -257,7 +243,7 @@ let configurationItems = {
implement(value) {
logger.debug(this.keypath, 'implement', value)

if (Boolean(value) === false) {
if (!!value === false) {
app.setBadgeCount(0)
}
}
Expand Down Expand Up @@ -423,7 +409,11 @@ let configurationItems = {
if (!primaryWindow) { return }
if (!primaryWindow.getBounds()) { return }

value === true ? primaryWindow.show() : primaryWindow.hide()
if (!!value) {
primaryWindow.show()
} else {
primaryWindow.hide()
}
}
},
/**
Expand Down
5 changes: 3 additions & 2 deletions app/scripts/main/menus/tray-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ let createTrayMenuTemplate = () => {
icon: trayMenuItemImageAppAutoUpdate,
type: 'checkbox',
checked: configurationManager('appAutoUpdate').get(),
enabled: !process.defaultApp,
click(menuItem) {
configurationManager('appAutoUpdate').set(menuItem.checked)
}
Expand Down Expand Up @@ -165,7 +166,7 @@ let createTrayMenuTemplate = () => {

if (sessionIndex === sessionList.length - 1) {
app.relaunch()
app.exit()
app.quit()
}
})
}
Expand All @@ -186,7 +187,7 @@ let createTrayMenuTemplate = () => {
logger.log('reconnect', 'relaunching')

app.relaunch()
app.exit()
app.quit()
}
})
}
Expand Down
10 changes: 7 additions & 3 deletions app/scripts/main/windows/main-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class MainWindow extends BrowserWindow {
super({
acceptFirstMouse: true,
autoHideMenuBar: true,
backgroundColor: platformTools.isMacOS ? void 0 : '#95A5A6',
// Hotfix (Electron v2.0.2, github.com/electron/electron/issues/12726)
// backgroundColor: platformTools.isMacOS ? void 0 : '#95A5A6',
backgroundColor: '#00000000',
frame: true,
hasShadow: platformTools.isMacOS ? true : void 0,
height: void 0,
Expand All @@ -63,8 +65,10 @@ class MainWindow extends BrowserWindow {
thickFrame: platformTools.isWindows ? true : void 0,
title: windowTitle,
titleBarStyle: platformTools.isMacOS ? 'hiddenInset' : void 0,
transparent: false,
vibrancy: platformTools.isMacOS ? 'ultra-dark' : void 0,
transparent: true,
// Hotfix (Electron v2.0.2, github.com/electron/electron/issues/12726)
// vibrancy: platformTools.isMacOS ? 'dark' : void 0,
vibrancy: void 0,
webPreferences: {
allowRunningInsecureContent: true,
backgroundThrottling: true,
Expand Down
6 changes: 4 additions & 2 deletions app/styles/elements/window.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ html
{
font-size: 62.5%;
-webkit-font-smoothing: antialiased;
background-color: transparent;
/* Hotfix (Electron v2.0.2, github.com/electron/electron/issues/12726) */
/* background-color: transparent; */
background-color: rgba(0, 0, 0, 0.75);
margin: 0;
padding: 0;
width: 100%;
Expand All @@ -18,7 +20,7 @@ html
}

/* body
========================================================================== */
========================================================================== */

body
{
Expand Down
16 changes: 10 additions & 6 deletions app/styles/injected/pushbullet-web.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
::-webkit-scrollbar-thumb
{
background: var(--color-accent-light) !important;
border-radius: none !important;
border-radius: 0 !important;
}

::-webkit-scrollbar-thumb:hover
Expand Down Expand Up @@ -74,11 +74,6 @@ html.darwin #sink > div > div > div:nth-child(1)
background-color: transparent !important;
}

.minitab:focus
{
outline: none;
}

html.darwin #mainbar
{
transform: translateX(-1px); !important;
Expand All @@ -95,3 +90,12 @@ div:not(.pushfont-close)
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
-webkit-font-smoothing: antialiased !important;
}

/* :focus
========================================================================== */

.minitab:focus,
#sidebar div.target.pointer:focus
{
outline: none !important;
}
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pb-for-desktop",
"appId": "de.sidneys.pb-for-desktop",
"productName": "PB for Desktop",
"version": "7.4.0",
"version": "7.6.0",
"description": "PB for Desktop is a Pushbullet desktop application for macOS, Windows and Linux",
"license": "MIT",
"homepage": "https://sidneys.github.io/pb-for-desktop",
Expand Down Expand Up @@ -53,7 +53,7 @@
"@sidneys/electron-localsetup": "^1.2.0",
"@sidneys/electron-notification-provider": "^0.3.0",
"@sidneys/electron-power-service": "^0.3.0",
"@sidneys/electron-updater-service": "^0.7.0",
"@sidneys/electron-updater-service": "^0.14.0",
"@sidneys/h264ify": "^1.0.3",
"@sidneys/is-env": "^1.3.0",
"@sidneys/logger": "^1.4.0",
Expand Down Expand Up @@ -85,7 +85,7 @@
"minimist": "^1.2.0",
"moment": "^2.22.2",
"opn": "^5.3.0",
"parse-domain": "^2.1.1",
"parse-domain": "^2.1.2",
"parse-semver": "^1.1.1",
"present": "^1.0.0",
"remove-markdown": "^0.3.0",
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
dependencies:
"@sidneys/logger" "^1.4.0"

"@sidneys/electron-updater-service@^0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@sidneys/electron-updater-service/-/electron-updater-service-0.7.0.tgz#a7a904215d1748d3b28f123738d6cb153c958058"
"@sidneys/electron-updater-service@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@sidneys/electron-updater-service/-/electron-updater-service-0.14.0.tgz#88e73f49b0197298f5c13df31a4dfdf153b19d48"
dependencies:
"@sidneys/electron-dialog-provider" "^1.3.0"
"@sidneys/electron-notification-provider" "0.3.0"
Expand Down Expand Up @@ -4091,9 +4091,9 @@ parse-color@^1.0.0:
dependencies:
color-convert "~0.5.0"

parse-domain@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/parse-domain/-/parse-domain-2.1.1.tgz#e3b4b423011b902367cf0685bc482f3afa673a4d"
parse-domain@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/parse-domain/-/parse-domain-2.1.2.tgz#8c536bdecf7a9af01bb6d7ad30eb794791d6c2c7"
dependencies:
chai "^4.1.2"
fs-copy-file-sync "^1.1.1"
Expand Down

0 comments on commit 98d6a4e

Please sign in to comment.