-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.js
More file actions
29 lines (25 loc) · 683 Bytes
/
utils.js
File metadata and controls
29 lines (25 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const defaultOpt = {
trigger: 'command+shift+h',
position: 'top',
height: 400,
hideOnBlur: false
};
const isMac = process.platform === 'darwin';
/**
* Make a window move to the current activated workspace.
* Ref: https://github.com/electron/electron/issues/8734#issuecomment-350145566
* @param {BrowserWindow} window Window that should be displayed
*/
function showInCurrentWorkspace(window) {
window.setVisibleOnAllWorkspaces(true);
window.focus();
window.setVisibleOnAllWorkspaces(false);
}
function mergeWithDefaultOption(opt) {
return Object.assign({}, defaultOpt, opt);
}
module.exports = {
showInCurrentWorkspace,
mergeWithDefaultOption,
isMac
};