If only it were that simple.

Sadly, Qt's design is such that all UI activity must happen on the main thread.

https://doc.qt.io/qt-5/thread-basics.html

Looking at how the system works, I believe that this was not the
original plan, but instead was an organic response to some of the very
reasonable expectations about how a user interface works.

Here, it's perhaps also worth noting that a typical web browser, while
it will use multiple threads, also uses multiple processes.
Effectively, giving control over some part of screen real estate or
some underlying form of infrastructure to an independent program. And,
the webview control is, roughly speaking, a web browser.

--
Raul

On Wed, Mar 22, 2023 at 6:36 PM Ed Gottsman <[email protected]> wrote:
>
> Hello.
>
> I've got a Window Driver application whose left side is an isigraph control 
> and whose right side is a webview control.  The webview loads pages in 
> response to interaction with the isigraph.
>
> The isigraph side is quite snappy despite almost zero optimization effort (a 
> tribute to the developers of the J runtime, the gl2 library, etc.).
>
> The webview…is much less responsive, even when loading locally-cached HTML.  
> In fact, as long as the mouse is moving and frames are being generated in the 
> isigraph, the webview is unresponsive.  Only when the mouse pauses (and no 
> frames are generated) does the webview load a page.
>
> I *think* that what's happening is that the two Window Driver child controls 
> share a core, and the isigraph side steals all of the available cycles to 
> service mouse-move events by generating frames, leaving no cycles for the 
> webview to parse and render HTML.
>
> With that in mind, it seems possible that I could improve the responsiveness 
> of the webview by threading off some or all of the (considerable) work that 
> goes into generating an isigraph frame, leaving most of the shared core's 
> cycles for the webview.
>
> I hesitate, however, before re-arranging the code because 1) I'm not sure 
> about the diagnosis and 2) I've worked in graphics environments where you're 
> not allowed to update GUI controls off the main thread and 3) maybe there's a 
> much simpler approach (can I somehow thread off the webview, e.g.?).
>
> Comments on any part of this would be greatly appreciated.
>
> Thank you.
>
> Ed
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to