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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Demos on Ubuntu lose focus

Post Reply
ericktux
Posts: 40
Joined: Thu Oct 29, 2020 10:11 am

Demos on Ubuntu lose focus

Post 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. :(
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Demos on Ubuntu lose focus

Post 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
Post Reply