Page 1 of 1

Demos on Ubuntu lose focus

Posted: Mon Mar 03, 2025 7:46 am
by ericktux
Hi friends, I have a problem. I'm trying out the demos on Ubuntu Linux and when I enter the browser, the keyboard focus is lost. I tried these codes on a button and the focus is restored:

Code: Select all

Form1.ActiveControl := CEFLinkedWindowParent1;
Form1.Chromium1.SetFocus(True);
or

Code: Select all

CEFLinkedWindowParent1.SetFocus;
Chromium1.Browser.Host.SetFocus(True); 
But when I click anywhere in the browser the focus is lost again and I can't use the keyboard.
Please help. :(

Re: Demos on Ubuntu lose focus

Posted: Mon Mar 03, 2025 11:35 am
by salvadordf
Hi,

Copy the code from the MiniBrowser demo for GTK2 that handle the TCEFLinkedWindowParent.OnEnter and TCEFLinkedWindowParent.OnExit events :
  • TMiniBrowserFrm.CEFLinkedWindowParent1Exit
  • TMiniBrowserFrm.CEFLinkedWindowParent1Enter