Skip to content

Don’t throw that Pi into the garbage

The most recent iteration of Pi, operating on the Bookworm OS, may cause Xojo’s DesktopHTMLViewer to appear like garbage, but that’s no reason to discard either the Pi or Xojo!

If you’re encountering display anomalies with the DesktopHTMLViewer on a Pi 5 running Bookworm OS, rest assured you’re not alone. This issue stems from the version of WebKitGTK the DesktopHTMLViewer relies on. While efforts to address this persist, a viable workaround exists: disabling hardware acceleration when utilizing WebKitGTK. Fortunately, in Xojo, we’ve facilitated this by exposing an environment variable. You can conveniently set this variable before the creation of the DesktopHTMLViewer, such as within your App.Opening event.

To turn hardware acceleration OFF, you can assign that to the WEBKIT_HARDWARE_ACCELERATION environment variable:

System.EnvironmentVariable("WEBKIT_HARDWARE_ACCELERATION") = "OFF"

By default, hardware acceleration is enabled/disabled as requested by web contents, but you can also force hardware acceleration to be enabled even for websites not requesting it:

System.EnvironmentVariable("WEBKIT_HARDWARE_ACCELERATION") = "ON"

To revert it to its default state, simply assign any value other than ON/OFF. While we remain optimistic that this issue will be resolved at some point, in the interim, this environment variable stands ready to function as a temporary solution.

William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.