Set x, y context menu position explicitly

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-12-14 13:48:54 +03:00
1 parent ed940cbfac
commit a9b6bb90f7
1 file changed
+7 -1
+7 -1
View File
@@ -152,7 +152,13 @@ export function initIpcMainHandlers() {
ipcMainOn(IpcMainWindowEvents.OPEN_CONTEXT_MENU, async (event) => {
const menu = Menu.buildFromTemplate(getAppMenu(WindowManager.getInstance()));
const options = {
...BrowserWindow.fromWebContents(event.sender),
// Center of the topbar menu icon
x: 20,
y: 20,
} as Electron.PopupOptions;
menu.popup(BrowserWindow.fromWebContents(event.sender) as Electron.PopupOptions);
menu.popup(options);
});
}