GO Gio not drawing window contents from dev container

67 views Asked by At

I am using the golang dev container from microsoft in vscode.

mcr.microsoft.com/devcontainers/go:1-1.22-bookworm

My hope was to use GIO for GUI development. Unfortunately, the GIO hello world example does not work. The window is displayed on the host PC (the container is not remote) but the window content never updates.

go run gioui.org/example/hello@latest

I have added the XDG_RUNTIME_DIR env variable as suggested elsewhere, but that didn't work. Here is my devcontainer.json:

{
    "name": "Go",
    "image": "mcr.microsoft.com/devcontainers/go:1-1.22-bookworm",
    "containerEnv": {
        "XDG_RUNTIME_DIR": "/tmp"
    },

    "postCreateCommand": "sudo apt update && sudo apt install -y gcc pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev",
}

This is an image of the issue: enter image description here

The GIO window is supposed to contain a button, but instead it's a sort of screen capture of vscode behind it. It's obviously not getting through the first draw call.

There are no errors in the console. As you can see from the devcontainer.json the required packages for GIO are installed.

To reproduce:

  1. Create a new dev container using mcr.microsoft.com/devcontainers/go:1-1.22-bookworm
  2. run sudo apt update && sudo apt install -y gcc pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev within the container to install requirements.
  3. run go run gioui.org/example/hello@latest
  4. Cry
0

There are 0 answers