Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow two instances of the app #55

Merged
merged 8 commits into from
Feb 19, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
open shadow on second instance
  • Loading branch information
lacymorrow committed Feb 19, 2021
commit c8191a5e5a46773801cf3c8465d34c9809e388fe
12 changes: 7 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ try {
// Note: Must match `build.appId` in package.json
app.setAppUserModelId( 'com.lacymorrow.crossover' )

// // Prevent multiple instances of the app
// if ( !app.requestSingleInstanceLock() ) {
// Prevent multiple instances of the app
if ( !app.requestSingleInstanceLock() ) {

// app.quit()
app.quit()

// }
}

// Fix for Linux transparency issues
if ( is.linux || config.get( 'app' ).DISABLE_GPU ) {
Expand Down Expand Up @@ -1043,7 +1043,7 @@ const setupShadowWindow = async shadow => {
if ( config.get( 'positionX' ) > -1 ) {

// Offset position slightly
setPosition( config.get( 'positionX' ), config.get( 'positionY' ) + 20, shadow )
setPosition( config.get( 'positionX' ) + 40, config.get( 'positionY' ) + 40, shadow )

}

Expand All @@ -1056,6 +1056,8 @@ app.on( 'second-instance', () => {

if ( mainWindow ) {

createShadowWindow()

if ( mainWindow.isMinimized() ) {

mainWindow.restore()
Expand Down