Skip to content

Commit

Permalink
More carefully handle restarting flyout
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Oct 30, 2024
1 parent 2e10619 commit 1c2716e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -2568,8 +2568,14 @@ function destroyPanel() {
}
}

let restartingPanel = false
function restartPanel(show = false) {
console.log("Function: restartPanel");
if(restartingPanel) {
console.log("Function: restartPanel: already restarting")
return false
}
restartingPanel = true
if (mainWindow) {
mainWindow.setBounds({ x: 0, y: 0, width: 0, height: 0 })
mainWindow.setOpacity(1)
Expand All @@ -2578,6 +2584,7 @@ function restartPanel(show = false) {
}
destroyPanel()
createPanel(show)
restartingPanel = false
}

function getPrimaryDisplay() {
Expand Down Expand Up @@ -3743,8 +3750,7 @@ function handleMonitorChange(t, e, d) {

// If displays not shown, refresh mainWindow
if(settings.reloadFlyout && !panelSize.visible) {
destroyPanel()
createPanel(false)
restartPanel(false)
}

handleChangeTimeout2 = false
Expand Down

0 comments on commit 1c2716e

Please sign in to comment.