Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Clicking on context menu item sometime has no response in OSR mode
Clicking on context menu item sometime has no response in OSR mode
Hi,
Clicking on context menu item sometime has no response in OSR mode. You have to click it for several times, then it works.
The context menu item is added by myself. I don't know the reason. It seems that the context menu in OSR mode is not stable.
Thank you!
Clicking on context menu item sometime has no response in OSR mode. You have to click it for several times, then it works.
The context menu item is added by myself. I don't know the reason. It seems that the context menu in OSR mode is not stable.
Thank you!
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Clicking on context menu item sometime has no response in OSR mode
Perhaps there's another control getting the focus while CEF shows the context menu.
Can you reproduce this issue with a demo? If so, please provide step by step instructions to reproduce it.
Can you reproduce this issue with a demo? If so, please provide step by step instructions to reproduce it.
Re: Clicking on context menu item sometime has no response in OSR mode
I have tested for several times.
It seems that when many webpages are opened, the CPU usage and memory usage are very high, this issue will be found. Especially when run out of memory nearly.
It seems that when many webpages are opened, the CPU usage and memory usage are very high, this issue will be found. Especially when run out of memory nearly.
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Clicking on context menu item sometime has no response in OSR mode
If CPU usage is too high then it's not rare to see that some applications have dificulties giving a fast response to user actions.
Try setting GlobalCEFApp.EnableGPU to True before the GlobalCEFApp.StartMainProcess call in the DPR file. This property will enable hardware acceleration using the graphics card.
Also try calling TChromium.WasHidden(True) to all the browsers that are not visible and then call TChromium.WasHidden(False) when they become visible. This will stop the TChromium.OnPaint event for that browser while it's hidden. There's a known CEF issue with this trick and you will have to resize the browser by 1 pixel after the TChromium.WasHidden(False) call to receive TChromium.OnPaint events again.
Try setting GlobalCEFApp.EnableGPU to True before the GlobalCEFApp.StartMainProcess call in the DPR file. This property will enable hardware acceleration using the graphics card.
Also try calling TChromium.WasHidden(True) to all the browsers that are not visible and then call TChromium.WasHidden(False) when they become visible. This will stop the TChromium.OnPaint event for that browser while it's hidden. There's a known CEF issue with this trick and you will have to resize the browser by 1 pixel after the TChromium.WasHidden(False) call to receive TChromium.OnPaint events again.
Re: Clicking on context menu item sometime has no response in OSR mode
Thank you for your advice. I'll try it.
Re: Clicking on context menu item sometime has no response in OSR mode
I also often encounter this bug, if you simply move the cursor over the pop-up menu or even open it, the screen sometimes turns black.


- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Clicking on context menu item sometime has no response in OSR mode
Thanks for reporting this issue!
I'll try to replicate it in my computer.
I'll try to replicate it in my computer.
Re: Clicking on context menu item sometime has no response in OSR mode
Problem in unit uCEFBufferPanel
The fix
Code: Select all
procedure TBufferPanel.BufferDraw(const aBitmap : TBitmap; const aSrcRect, aDstRect : TRect);
begin
if (FBuffer <> nil) then
FBuffer.Canvas.CopyRect(aDstRect, aBitmap.Canvas, aSrcRect);
end;
Code: Select all
procedure TBufferPanel.BufferDraw(const aBitmap : TBitmap; const aSrcRect, aDstRect : TRect);
begin
if (FBuffer <> nil) then
begin
FBuffer.Canvas.Lock;
aBitmap.Canvas.Lock;
FBuffer.Canvas.CopyRect(aDstRect, aBitmap.Canvas, aSrcRect);
aBitmap.Canvas.UnLock;
FBuffer.Canvas.Unlock;
end;
end;
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Clicking on context menu item sometime has no response in OSR mode
Thank you very much for the fix! 

- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Clicking on context menu item sometime has no response in OSR mode
I just uploaded your fix.
Thanks again!
Thanks again!
