fixed context menu and xterm mouse events (fixes #442)

This commit is contained in:
Eugene Pankov
2018-10-05 10:02:03 +01:00
parent a931d47c23
commit 87933edb96
4 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'
import { TouchBar, BrowserWindow } from 'electron'
import { TouchBar, BrowserWindow, Menu } from 'electron'
@Injectable()
export class ElectronService {
@@ -14,6 +14,7 @@ export class ElectronService {
remote: any
TouchBar: typeof TouchBar
BrowserWindow: typeof BrowserWindow
Menu: typeof Menu
private electron: any
constructor () {
@@ -29,6 +30,7 @@ export class ElectronService {
this.nativeImage = this.remote.nativeImage
this.TouchBar = this.remote.TouchBar
this.BrowserWindow = this.remote.BrowserWindow
this.Menu = this.remote.Menu
}
remoteRequire (name: string): any {

View File

@@ -169,7 +169,7 @@ export class HostAppService {
}
popupContextMenu (menuDefinition: Electron.MenuItemConstructorOptions[]) {
this.electron.ipcRenderer.send('window-popup-context-menu', menuDefinition)
this.electron.Menu.buildFromTemplate(menuDefinition).popup({})
}
broadcastConfigChange () {