Welcome Guest Search | Active Topics | Sign In | Register

Can I run EO browser on non main thread? Options
SNK
Posted: Thursday, March 23, 2023 8:33:21 PM
Rank: Newbie
Groups: Member

Joined: 4/27/2022
Posts: 5
I use EO browser inside WPF dialog in Excel addin. Currently, the browser is running on the main thread. It's almost all good except when the users switch between the browser and Excel, the focus may not switch correctly when they are clicking on a cell in a worksheet. I think, this may be happening because the dialog needs to be running on a separate thread. Is it possible to do? Thanks.
eo_support
Posted: Friday, March 24, 2023 10:03:55 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

No. The browser should run in the main UI thread. However we are not sure whether your plugin main thread is indeed Excel's main UI thread. That might be something you want to check.

Regardless, it's unlikely the focus issue has anything to do with thread. Most likely it occurs because Excel and WPF has some kind of focus caching/restoring mechanism in play. Can you describe in detail on how the focus may not switch correctly?

Thanks!
SNK
Posted: Monday, March 27, 2023 1:05:03 AM
Rank: Newbie
Groups: Member

Joined: 4/27/2022
Posts: 5
Hi,

I did test it. It doesn't have anything to do with EO Browser. It just Excel and WPF dialogs. If I open a new dialog (empty) on a main thread, I will get this issue - Excel cells are selectable while the focus is still on the dialog. If I create a new task with this dialog and start it on another thread, then every time I click on the cells the focus fully moves over to Excel.
eo_support
Posted: Monday, March 27, 2023 10:05:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

In that case you might want to try Windows.Forms instead. WPF does have its own focus managing mechanism because multiple focusable WPF controls share a single window handle. On Windows.Forms on the other hand every control has its own window handle, so focus is managed by Windows instead. This might work better in your case.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.