Skip to content

Commit

Permalink
Fix for chooser closing on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lacymorrow committed Jun 23, 2020
1 parent fc41447 commit 5fdab03
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ try {
// Note: Must match `build.appId` in package.json
app.setAppUserModelId( 'com.lacymorrow.crossover' )

// Fix for Linux transparency issues
if ( is.linux ) {

app.commandLine.appendSwitch('enable-transparent-visuals')
app.commandLine.appendSwitch('disable-gpu')
app.disableHardwareAcceleration()

}

// Uncomment this before publishing your first version.
// It's commented out as it throws an error if there are no published versions.
try {
Expand Down Expand Up @@ -492,15 +501,25 @@ app.on( 'ready', () => {

} )

ipcMain.on( 'open_chooser', ( ..._ ) => {
ipcMain.on( 'open_chooser', async ( ..._ ) => {

if ( chooserWindow && !config.get( 'windowLocked' ) ) {
// Don't do anything if locked
if ( config.get( 'windowLocked' ) ) {

chooserWindow.show()
globalShortcut.register( 'Escape', hideChooserWindow )
return

}

if ( !chooserWindow ) {

chooserWindow = await createChildWindow( mainWindow )

}

// Create shortcut to close chooser
globalShortcut.register( 'Escape', hideChooserWindow )
chooserWindow.show()

} )

ipcMain.on( 'save_color', ( event, arg ) => {
Expand Down

0 comments on commit 5fdab03

Please sign in to comment.