1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Set x, y context menu position explicitly

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-12-14 13:48:54 +03:00
parent ed940cbfac
commit a9b6bb90f7

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);
});
}