U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » U++ Developers corner » Native Browser inside U++ Ctrl
Native Browser inside U++ Ctrl [message #62005] Sat, 23 May 2026 09:40 Go to next message
forlano is currently offline  forlano
Messages: 1239
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

this looks much better : webview2 for windows. We have a free top edge browser with printing using the dll offered by Windows

/forums/index.php?t=getfile&id=7160&private=0

Luigi

[Updated on: Sat, 23 May 2026 12:26]

Report message to a moderator

Re: Native Browser inside U++ Ctrl [message #62006 is a reply to message #62005] Sat, 23 May 2026 12:28 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1239
Registered: March 2006
Location: Italy
Senior Contributor
Here is webkit for macOS

/forums/index.php?t=getfile&id=7161&private=0

Re: Native Browser inside U++ Ctrl [message #62008 is a reply to message #62006] Sat, 23 May 2026 15:57 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1239
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

with Linux there are troubbles!

/forums/index.php?t=getfile&id=7162&private=0

The browser is detached by the Ctrl  Shocked

In another post I asked how to attach a GtkWindow to U++ window.
Please give me some advice fo fix the issue and each platforms will have its Browser embedded.

Thanks,
Luigi
Re: Native Browser inside U++ Ctrl [message #62009 is a reply to message #62008] Sat, 23 May 2026 21:34 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1239
Registered: March 2006
Location: Italy
Senior Contributor
Now on linux works with a workaround: the browser appear in a popup that follow the geometry of the ctrl.
I hope to get more info to fix it properly.

Thanks,
Luigi
Re: Native Browser inside U++ Ctrl [message #62010 is a reply to message #62009] Sun, 24 May 2026 13:09 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1239
Registered: March 2006
Location: Italy
Senior Contributor
Ok, now works on Linux too but as a popup. However the z-order of the popup is kept under control.
Later I'll publish the project and a proposal to do a little modification in GtkCreate.cpp for future development.

Luigi
Re: Native Browser inside U++ Ctrl [message #62013 is a reply to message #62010] Thu, 28 May 2026 17:23 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 704
Registered: December 2005
Location: Budapest, Hungary
Contributor
Did you use a wrapper library like this one or use the platform's webviews solutions directly?
Re: Native Browser inside U++ Ctrl [message #62014 is a reply to message #62013] Thu, 28 May 2026 19:33 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1239
Registered: March 2006
Location: Italy
Senior Contributor
zsolt wrote on Thu, 28 May 2026 17:23
Did you use a wrapper library like this one or use the platform's webviews solutions directly?
No, we do NOT use the webview wrapper. We use the platform's native APIs directly.

The reason is exactly what you might expect: webview is designed to create its own top-level window and run its own event loop via `webview::run()`. This makes it fundamentally incompatible with embedding inside an existing U++ `Ctrl` — two event loops cannot coexist in the same application.

Instead we call the platform APIs directly:

- **Windows**: `ICoreWebView2` COM API (WebView2 SDK). Loaded at runtime via `LoadLibrary("WebView2Loader.dll")` to avoid static linking issues with Clang. The WebView2 controller is created as a child of the `TopWindow` HWND.

- **macOS**: `WKWebView` (WebKit.framework) via Objective-C++ in a file that is kept completely separate from U++ code to avoid namespace conflicts between Cocoa types (`NSRect`, `NSPoint`) and U++ types (`Rect`, `Point`).

- **Linux**: `WebKitWebView` (webkit2gtk-4.1). Since U++ renders everything with Cairo on a single `GtkDrawingArea` (not a `GtkContainer`), true embedding is not possible without patching U++ core. We currently use a `GTK_WINDOW_TOPLEVEL` with `GDK_WINDOW_TYPE_HINT_UTILITY`, synchronized with the U++ window via `configure-event` and `focus-in/out` signals for correct z-order management.
Re: Native Browser inside U++ Ctrl [message #62016 is a reply to message #62014] Thu, 04 June 2026 02:24 Go to previous message
zsolt is currently offline  zsolt
Messages: 704
Registered: December 2005
Location: Budapest, Hungary
Contributor
Thanks Luigi, I hope I will have some time to play with it a bit.
Previous Topic: HTML viewer
Next Topic: Technology lab vs External resources
Goto Forum:
  


Current Time: Thu Jun 04 10:27:35 GMT+2 2026

Total time taken to generate the page: 0.00618 seconds