Hi,
I use the onSetFocus method setting result := true when i want to avoid the browser to steal focus. It always worked well but looks like the last update broke this functionality ; the browser is stealing focus anyway.
Can anyone confirm this please ?
Thanks
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.
OnSetFocus not working
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: OnSetFocus not working
Hi,
I just did some tests with the TabbedBrowser2 demo.
I added a small TEdit in the left panel and I used the OnKeyUp to create a new tab when I press the "a" key.
The unmodified TabbedBrowser2 demo set the focus on the new browser tab but then I did a couple of modifications :
I just did some tests with the TabbedBrowser2 demo.
I added a small TEdit in the left panel and I used the OnKeyUp to create a new tab when I press the "a" key.
The unmodified TabbedBrowser2 demo set the focus on the new browser tab but then I did a couple of modifications :
- Use the TChromium.OnSetFocus event and set Result to true
- Set TChromium.DefaultWindowInfoExStyle to WS_EX_NOACTIVATE before the TChromium.CreateBrowser call.
Re: OnSetFocus not working
To prevent the browser from stealing focus, I usually set the enabled = false property of TchromiumWindow, when I know for sure that this browser is not used, and when the tab is activated, then enabled = true
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: OnSetFocus not working
I'll do some tests with these suggestions.
What i noticed is, when my application is idle but with some web page open (Instagram for instance), randomly the app will popup in front of other windows, probably because a new notification has arrived on Instagram, for instance. This behaviour did not happen prior to recent updates.
What i noticed is, when my application is idle but with some web page open (Instagram for instance), randomly the app will popup in front of other windows, probably because a new notification has arrived on Instagram, for instance. This behaviour did not happen prior to recent updates.