working communication between renderer and main process
This commit is contained in:
@@ -43,9 +43,10 @@ const createWindow = (): void => {
|
|||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
// Some APIs can only be used after this event occurs.
|
// Some APIs can only be used after this event occurs.
|
||||||
app.on('ready', createWindow);
|
app
|
||||||
|
.whenReady()
|
||||||
app.whenReady().then(() => {
|
.then(createWindow)
|
||||||
|
.then(() => {
|
||||||
// dynamically changing the window bounds
|
// dynamically changing the window bounds
|
||||||
ipcMain.on(Channels.RESIZE_WINDOW, (event, req: DimensionChangeRequest) => {
|
ipcMain.on(Channels.RESIZE_WINDOW, (event, req: DimensionChangeRequest) => {
|
||||||
if (req.setAlwaysOnTop) {
|
if (req.setAlwaysOnTop) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export function ElectronProvider({ children }: { children: React.ReactNode }) {
|
|||||||
setIsWindowFocused(false);
|
setIsWindowFocused(false);
|
||||||
|
|
||||||
// TODO: testing mode... uncomment both instructions below
|
// TODO: testing mode... uncomment both instructions below
|
||||||
setDesktopMode('overlayOnly');
|
// setDesktopMode('overlayOnly');
|
||||||
});
|
});
|
||||||
|
|
||||||
window.electronAPI.on(Channels.ON_WINDOW_FOCUS, () => {
|
window.electronAPI.on(Channels.ON_WINDOW_FOCUS, () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user