Page 1 of 1

Weird focus & context menu problems on Linux

PostPosted: Tue Dec 14, 2021 11:40 am
by Peter
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)...

Re: Weird focus & context menu problems on Linux

PostPosted: Tue Nov 08, 2022 6:55 pm
by calkins
Hi!

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

thanks.

Re: Weird focus & context menu problems on Linux

PostPosted: Tue Nov 08, 2022 7:13 pm
by edgardog
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.

Re: Weird focus & context menu problems on Linux

PostPosted: Tue Nov 08, 2022 7:31 pm
by calkins
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.

Re: Weird focus & context menu problems on Linux

PostPosted: Wed Nov 30, 2022 6:51 pm
by calkins
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?