GTK Hello World example shows runtime error

Folks,

I am a newbie to GTK4. I’ve built it OK but when I run the hello world program, I get:

Failed to realize renderer of type ‘GskNglRenderer’ for surface ‘GdkX11Toplevel’: No available configurations for the given pixel format

I am running Debian 10, running in a parallels VM on an AppleMac (intel).

I tried xdpyinfo, but didn’t know any next steps. Output from xdpyinfo (if needed is below).

Please can anyone point me in the right direction?

name of display: :0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 12004000
X.Org version: 1.20.4
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7
supported pixmap formats:
depth 1, bits_per_pixel 1, scanline_pad 32
depth 4, bits_per_pixel 8, scanline_pad 32
depth 8, bits_per_pixel 8, scanline_pad 32
depth 15, bits_per_pixel 16, scanline_pad 32
depth 16, bits_per_pixel 16, scanline_pad 32
depth 24, bits_per_pixel 32, scanline_pad 32
depth 32, bits_per_pixel 32, scanline_pad 32
keycode range: minimum 8, maximum 255
focus: window 0x2800006, revert to Parent
number of extensions: 28
BIG-REQUESTS (opcode: 134)
Composite (opcode: 143)
DAMAGE (opcode: 144, base event: 91, base error: 152)
DOUBLE-BUFFER (opcode: 146, base error: 153)
DPMS (opcode: 148)
DRI2 (opcode: 154, base event: 102)
GLX (opcode: 155, base event: 104, base error: 170)
Generic Event Extension (opcode: 129)
MIT-SCREEN-SAVER (opcode: 145, base event: 92)
MIT-SHM (opcode: 131, base event: 65, base error: 128)
ParallelsControl (opcode: 128)
Present (opcode: 149)
RANDR (opcode: 141, base event: 89, base error: 147)
RECORD (opcode: 147, base error: 154)
RENDER (opcode: 140, base error: 142)
SECURITY (opcode: 138, base event: 86, base error: 138)
SHAPE (opcode: 130, base event: 64)
SYNC (opcode: 135, base event: 83, base error: 134)
X-Resource (opcode: 150)
XC-MISC (opcode: 137)
XFIXES (opcode: 139, base event: 87, base error: 140)
XFree86-DGA (opcode: 153, base event: 95, base error: 165)
XFree86-VidModeExtension (opcode: 152, base error: 158)
XINERAMA (opcode: 142)
XInputExtension (opcode: 132, base event: 66, base error: 129)
XKEYBOARD (opcode: 136, base event: 85, base error: 137)
XTEST (opcode: 133)
XVideo (opcode: 151, base event: 93, base error: 155)
default screen number: 0
number of screens: 1

screen #0:
dimensions: 1221x846 pixels (323x224 millimeters)
resolution: 96x96 dots per inch
depths (7): 1, 4, 8, 15, 16, 24, 32
root window id: 0x56
depth of root window: 24 planes
number of colormaps: minimum 1, maximum 1
default colormap: 0x20
default number of colormap cells: 256
preallocated pixels: black 0, white 16777215
options: backing-store WHEN MAPPED, save-unders NO
largest cursor: 64x64
current input event mask: 0xda0003
KeyPressMask KeyReleaseMask StructureNotifyMask
SubstructureNotifyMask SubstructureRedirectMask PropertyChangeMask
ColormapChangeMask
number of visuals: 4
default visual id: 0x21
visual:
visual id: 0x21
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0x22
class: DirectColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0x23
class: TrueColor
depth: 32 planes
available colormap entries: 2048 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0x24
class: DirectColor
depth: 32 planes
available colormap entries: 2048 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits

You can try with:

export GSK_RENDERER=cairo

In your environment.

Thank you! The error goes away!
However, there is no frame around the “Hello World” button. (All the window is the button.) I can raise a separate query on this.

Is there a particular reason why you’re running this code into a VM using X11?

GTK4 has a native macOS backend.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.