Skip to content
Snippets Groups Projects
Commit ea3928ee authored by David Bühler's avatar David Bühler
Browse files

Merge branch '1270-erreur-avec-multiples-instances-d-ivette' into 'stable/cobalt'

Resolve "Erreur avec multiples instances d'Ivette"

See merge request frama-c/frama-c!4228
parents a1f8d329 c857f50c
No related branches found
No related tags found
No related merge requests found
......@@ -483,18 +483,15 @@ function createBrowserWindow(
theWindow.off('close', closeHandler);
// Do not close the window yet
event.preventDefault();
// Save state
handle.frame = theWindow.getBounds();
handle.devtools = webContents.isDevToolsOpened();
webContents.send('dome.ipc.closing');
// Start closing process
webContents.send('dome.ipc.closing', wid);
};
theWindow.on('close', closeHandler);
ipcMain.on('dome.ipc.closing.done', () => {
theWindow.close();
});
// Keep track of frame positions (in DEVEL)
if (DEVEL) {
const saveFrame = _.debounce(() => {
......@@ -509,6 +506,11 @@ function createBrowserWindow(
return theWindow;
}
ipcMain.on('dome.ipc.closing.done', (_event, wid:number) => {
const handle = WindowHandles.get(wid);
if (handle !== undefined) handle.window.close();
});
// --------------------------------------------------------------------------
// --- Application Window(s) & Command Line
// --------------------------------------------------------------------------
......
......@@ -251,9 +251,9 @@ export const globalSettings = new Event(Settings.global);
// --- Closing
// --------------------------------------------------------------------------
ipcRenderer.on('dome.ipc.closing', async () => {
ipcRenderer.on('dome.ipc.closing', async (_event, wid: number) => {
await System.doExit();
ipcRenderer.send('dome.ipc.closing.done');
ipcRenderer.send('dome.ipc.closing.done', wid);
});
/** Register a callback to be executed when the window is closing. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment