Skip to content

Commit

Permalink
fix comment typo, make context menu work on secondary windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gtritchie committed Aug 18, 2021
1 parent 49536ca commit 7521113
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/node/desktop/src/main/context-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function showContextMenuImageTemplate(event: Electron.IpcMainEvent, params: Elec

function showContextMenuTextTemplate(event: Electron.IpcMainEvent, params: Electron.ContextMenuParams): ContextMenuItem[] {

// We would like to just alwaus use the already-existing roles for clipboard
// We would like to just always use the already-existing roles for clipboard
// actions, but https://www.electronjs.org/docs/api/menu-item has:
//
// When specifying a role on macOS, label and accelerator are the only options
Expand Down
12 changes: 6 additions & 6 deletions src/node/desktop/src/main/desktop-browser-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class DesktopBrowserWindow extends EventEmitter {
private opener?: WebContents,
private allowExternalNavigate = false,
addApiKeys: string[] = [],
existingWindow?: BrowserWindow
existingWindow?: BrowserWindow // attach to this window instead of creating a new one
) {
super();
const apiKeys = [['desktopInfo', ...addApiKeys].join('|')];
Expand All @@ -77,16 +77,16 @@ export class DesktopBrowserWindow extends EventEmitter {
acceptFirstMouse: true
});

// register context menu (right click) handler
this.window.webContents.on('context-menu', (event, params) => {
showContextMenu(event as IpcMainEvent, params);
});

// Uncomment to have all windows show dev tools by default
// this.window.webContents.openDevTools();

}

// register context menu (right click) handler
this.window.webContents.on('context-menu', (event, params) => {
showContextMenu(event as IpcMainEvent, params);
});

this.window.webContents.on('before-input-event', (event, input) => {
this.keyPressEvent(event, input);
});
Expand Down

0 comments on commit 7521113

Please sign in to comment.