No response to mouse events in multi-process mode.

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

No response to mouse events in multi-process mode.

Postby dmodi » Thu Jan 16, 2020 12:42 am

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.
dmodi
Newbie
 
Posts: 5
Joined: Thu Jan 16, 2020 12:26 am

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

Postby magreenblatt » Thu Jan 16, 2020 3:37 am

You cannot create native dialogs in the renderer process. You should instead create the dialog in the main process.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

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

Postby dmodi » Thu Jan 16, 2020 5:35 am

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];
});
dmodi
Newbie
 
Posts: 5
Joined: Thu Jan 16, 2020 12:26 am

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

Postby magreenblatt » Thu Jan 16, 2020 5:43 am

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.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

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

Postby dmodi » Fri Jan 17, 2020 1:50 am

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.
dmodi
Newbie
 
Posts: 5
Joined: Thu Jan 16, 2020 12:26 am

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

Postby magreenblatt » Fri Jan 17, 2020 3:20 am

That is also covered in the above link.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 45 guests