--- gtk-4.16.12/gdk/x11/gdkdisplay-x11.c.orig
+++ gtk-4.16.12/gdk/x11/gdkdisplay-x11.c
@@ -2977,6 +2977,12 @@
    * EGL, we want to avoid using it in favor of GLX.
    */
 
+   /*  EGL does not work on openindiana. Only test for GLX. */
+#ifdef __sun
+   if (gdk_x11_display_init_glx (self, out_visual, out_depth, error))
+     return TRUE;
+   return FALSE;
+#else
   if (!gdk_display_init_egl (display, EGL_PLATFORM_X11_KHR, dpy, FALSE, error))
     {
       g_clear_error (error);
@@ -3009,6 +3015,7 @@
   XFree (visinfo);
 
   return TRUE;
+#endif
 }
 
 static GdkGLContext *