Skip to content

Fix C++ event window lookup and Linux WebKit navigation handling; update serve_a_folder example#685

Merged
AlbertShown merged 3 commits intowebui-dev:mainfrom
triuk:main
Feb 18, 2026
Merged

Fix C++ event window lookup and Linux WebKit navigation handling; update serve_a_folder example#685
AlbertShown merged 3 commits intowebui-dev:mainfrom
triuk:main

Conversation

@triuk
Copy link
Contributor

@triuk triuk commented Feb 17, 2026

Summary

This PR includes three follow-up changes after the member-function bind support:

  1. C++ API fix for the b36c04e:

    • event::get_window() now resolves the window using bind_id (not window), preventing invalid callback-window lookups.
  2. Linux/WebKit navigation fix:

    • webui_navigate() Linux WebView path now goes through webui_show(window, url) to avoid navigation re-entrancy crashes when called from all-events navigation handlers.
  3. Example updates:

    • examples/C++/serve_a_folder was refactored to a class-based style using member-function binding.
    • Added serve_a_folder to CMake examples target registration.
    • Updated C++ examples README accordingly.

Validation

  • Built successfully in debug build (serve_a_folder target).
  • Verified that:
    • OpenNewWindow works,
    • SwitchToSecondPage works,
    • link navigation from the page no longer crashes in the tested Linux/WebKit setup.
  • I also verified examples on Windows (Chromium)
  • I did not verify on macOS.

@AlbertShown AlbertShown merged commit 8e55cff into webui-dev:main Feb 18, 2026
26 checks passed
@AlbertShown
Copy link
Member

Thank you @triuk, useful contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments