focus & blur callback are added
This commit is contained in:
parent
38eb6f7939
commit
705e74a27b
|
@ -27,7 +27,8 @@ export enum ElectronBrowserWindowChannel {
|
||||||
Close = 'close',
|
Close = 'close',
|
||||||
Closed = 'closed',
|
Closed = 'closed',
|
||||||
ReadyToShow = 'ready-to-show',
|
ReadyToShow = 'ready-to-show',
|
||||||
Focus = 'focus'
|
Focus = 'focus',
|
||||||
|
Blur = 'blur'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ElectronWebContentsChannel {
|
export enum ElectronWebContentsChannel {
|
||||||
|
|
|
@ -84,6 +84,14 @@ export class AppWindow {
|
||||||
event.returnValue = true;
|
event.returnValue = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.window.on(ElectronBrowserWindowChannel.Focus, () => {
|
||||||
|
console.log('window got focus');
|
||||||
|
});
|
||||||
|
|
||||||
|
this.window.on(ElectronBrowserWindowChannel.Blur, () => {
|
||||||
|
console.log('window blur');
|
||||||
|
});
|
||||||
|
|
||||||
// on macOS, when the user closes the window we really just hide it. This
|
// on macOS, when the user closes the window we really just hide it. This
|
||||||
// lets us activate quickly and keep all our interesting logic in the
|
// lets us activate quickly and keep all our interesting logic in the
|
||||||
// renderer.
|
// renderer.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user