Page 1 of 1

No response to mouse events in multi-process mode.

PostPosted: Thu Jan 16, 2020 12:42 am
by dmodi
Hi,

I am building a CEF application in MacOS Catalina. I was previously using CEF in single-process mode and it was working fine. Recently, I removed the single-process flag and created a helper process(I did not have a helper process before). Now, my app is working fine except there is an .XIB dialog which is now loaded from the renderer process. This dialog is not responding to any mouse click or hover. Somebody please guide me on what might get wrong.

Re: No response to mouse events in multi-process mode.

PostPosted: Thu Jan 16, 2020 3:37 am
by magreenblatt
You cannot create native dialogs in the renderer process. You should instead create the dialog in the main process.

Re: No response to mouse events in multi-process mode.

PostPosted: Thu Jan 16, 2020 5:35 am
by dmodi
magreenblatt wrote:You cannot create native dialogs in the renderer process. You should instead create the dialog in the main process.


The dialog is a NSWindowController object.It has to be invoked from the renderer process. I have enclosed the code within a dispatch_sync block.
dispatch_sync(dispatch_get_main_queue(), ^{
(void) [self window]; // make sure that the window is loaded
[self showWindow:self];
});

Re: No response to mouse events in multi-process mode.

PostPosted: Thu Jan 16, 2020 5:43 am
by magreenblatt
Sorry, that's not possible. You can implement a dialog using HTML/JS code, or you can send an async message to the main process as described here and trigger the native dialog there.

Re: No response to mouse events in multi-process mode.

PostPosted: Fri Jan 17, 2020 1:50 am
by dmodi
Thanks. I tried invoking it from the browser process using IPC and it works fine. Thanks a lot. Can you tell me how to send a message from browser process to renderer process.

Re: No response to mouse events in multi-process mode.

PostPosted: Fri Jan 17, 2020 3:20 am
by magreenblatt
That is also covered in the above link.