Weird focus & context menu problems on Linux

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.

Weird focus & context menu problems on Linux

Postby Peter » Tue Dec 14, 2021 11:40 am

Hello!

My project has to target a specific (and rather old) version of Debian Linux, that also turns out to have these weird problems with the CEF-based application that I do not see happening anywhere else:

- browser windows lose focus after the main window is minimized and restored. It used to lose focus after maximize-restore too, but I managed to fix this by calling SetFocus(true) on restore - but, in case of minimize-restore this does not help.

- browser windows stop showing right-click context menus after two(!) left mouse button clicks - except for clicks that close a previously opened context menu(?!) ClientHandler::OnBeforeContextMenu() is still being called, but the menu itself does not show up. The only way to fix this behaviour until next unfocus/refocus that I found is to click on some focusable GTK control(s) on the main window, after which context menus pop up normally.

This is reproducible in the CEFClient example, the latest CEF version we can use on this system is 3112.

Perhaps somebody remembers if there ever were such problems, and if there was a fix or a workaround?
As I understand, the way CEF child windows are shown on top of a GTK main window is not entirely "correct" by GTK standards, so GTK might not know where to put the input focus in these specific cases? Anyway I'm looking for workaround(s)...
Peter
Techie
 
Posts: 38
Joined: Thu Mar 05, 2020 9:41 am

Re: Weird focus & context menu problems on Linux

Postby calkins » Tue Nov 08, 2022 6:55 pm

Hi!

Did you ever find a work around? Im finding this issue exists for me on newest Linux branch as well.

thanks.
calkins
Techie
 
Posts: 10
Joined: Thu Aug 11, 2022 3:26 pm

Re: Weird focus & context menu problems on Linux

Postby edgardog » Tue Nov 08, 2022 7:13 pm

calkins wrote:Hi!

Did you ever find a work around? Im finding this issue exists for me on newest Linux branch as well.

thanks.

Are you on the latest branch?
I had these problems in linux and they went away about 8 months ago I think with chrome 100.
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm

Re: Weird focus & context menu problems on Linux

Postby calkins » Tue Nov 08, 2022 7:31 pm

edgardog wrote:
calkins wrote:Hi!

Did you ever find a work around? Im finding this issue exists for me on newest Linux branch as well.

thanks.

Are you on the latest branch?
I had these problems in linux and they went away about 8 months ago I think with chrome 100.


I am on 5249 branch. It is also reproducible on latest open-Spotify cefsimple example. Im on Ubunutu 22.04. Steps to reproduce is to open cefsimple, right click to see it working, then minimize and reopen. Right clicking no longer works for me.
calkins
Techie
 
Posts: 10
Joined: Thu Aug 11, 2022 3:26 pm

Re: Weird focus & context menu problems on Linux

Postby calkins » Wed Nov 30, 2022 6:51 pm

According to bitbucket it looks like the solution is to use views: https://bitbucket.org/chromiumembedded/cef/issues/3330/alloy-use-views-context-menus-on-windows#comment-63241273

This isn't a very good solution for our use case as we based our code off of cefsimple reparenting the created browser. Is there another fix for the context menu issue?
calkins
Techie
 
Posts: 10
Joined: Thu Aug 11, 2022 3:26 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 40 guests