How to identify gdk window backend at runtime

It seems that gtk only provides compile time macros such as GDK_IS_X11_DISPLAY

1 Like

https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkpopover.c#L772

The #ifdef checks whether GTK was compiled with wayland support. The GTK_IS_WAYLAND_DISPLAY() is a runtime check.

1 Like

You can follow the example in the GDK documentation which explains how to use compile time and run time checks to know the backend currently in use.

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