# racket-webview-qt

The Qt WebEngine backend of `racket-webview`.

## Version 0.2.3

This version replaces the shared-library/shared-memory transport with a
standalone process interface.

## Transport

`rktwebview_prg` receives line-delimited JSON commands on stdin, writes
line-delimited JSON results and events to stdout, and writes all diagnostics to
stderr. The existing command numbers and command payloads in `rkt_protocol.h`
are unchanged.

See `STDIO-PROTOCOL.md` for the transport envelope and shutdown rules.

The former shared library, shared-memory queue, and callback sources remain in
the repository for comparison, but they are no longer part of the CMake target.

## Build

The CMake target requires Qt Widgets and Qt WebEngineWidgets and builds only:

```text
rktwebview_prg
```

## Previous Qt update

QtWebEngine select popup rendering issues were observed with older Qt 6.x. The
native HTML `<select>` popup could keep growing or repainting while open while
the QtWebEngine process remained busy. Upgrading to Qt 6.11.1 resolved this.

## Integration test

`rktwebview_test` starts the built `rktwebview_prg` with `QProcess` and tests
the stdio handshake, request/result matching, basic webview commands, and clean
shutdown. Run it from the build directory:

```sh
./rktwebview_test
```

For a protocol-only test that does not create a window:

```sh
./rktwebview_test --protocol-only
```

Set `RKT_WEBVIEW_PRG` to test a backend executable outside the test program's
directory.

### Backend logging

Diagnostics written through `utils.h` use one-line structured stderr records:

```text
json:{"topic":"webview-backend","level":"info","elapsed":0.125,"message":"..."}
```

Stdout remains reserved for protocol messages. Unstructured stderr output from
Qt or third-party libraries may still occur and should be treated as diagnostic
text.
