Simple example of a wayland client with xdg-shell and EGL This article provides a C code example demonstrating how to create a Wayland client that uses the xdg-shell protocol and EGL for OpenGL rendering. The code includes setup for the Wayland display, registry, compositor, and xdg-shell components, along with EGL surface and context initialization. It also implements listeners for handling window configuration, resizing, and close events. Last active May 23, 2026 23:52 - - Save lmarz/1059f7c4101a15e2a04d6991d7b7b3d1 to your computer and use it in GitHub Desktop. Simple example of a wayland client with xdg-shell and EGL This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters https://github.co/hiddenchars | / Compile with: | | | wayland-scanner private-code /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml xdg-shell.c | | | wayland-scanner client-header /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml xdg-shell.h | | | gcc -c xdg-shell.c | | | gcc -c egl-on-wayland-xdg.c | | | gcc -o egl-on-wayland-xdg xdg-shell.o egl-on-wayland-xdg.o -lwayland-egl -lwayland-client -lEGL -lGL | | | / | | | include