{"record":{"id":"a13af9401cb5d975","repo":"fyne-io/fyne","slug":"eglgetdisplay-failed-n","errorCode":null,"errorMessage":"eglGetDisplay failed\\n","messagePattern":"eglGetDisplay failed\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/driver/mobile/app/x11.c","lineNumber":106,"sourceCode":"\treturn win;\n}\n\nDisplay *x_dpy;\nEGLDisplay e_dpy;\nEGLContext e_ctx;\nEGLSurface e_surf;\nWindow win;\n\nvoid\ncreateWindow(void) {\n\tx_dpy = XOpenDisplay(NULL);\n\tif (!x_dpy) {\n\t\tfprintf(stderr, \"XOpenDisplay failed\\n\");\n\t\texit(1);\n\t}\n\te_dpy = eglGetDisplay(x_dpy);\n\tif (!e_dpy) {\n\t\tfprintf(stderr, \"eglGetDisplay failed\\n\");\n\t\texit(1);\n\t}\n\tEGLint e_major, e_minor;\n\tif (!eglInitialize(e_dpy, &e_major, &e_minor)) {\n\t\tfprintf(stderr, \"eglInitialize failed\\n\");\n\t\texit(1);\n\t}\n\teglBindAPI(EGL_OPENGL_ES_API);\n\twin = new_window(x_dpy, e_dpy, 500, 1000, &e_ctx, &e_surf);\n\n\twm_delete_window = XInternAtom(x_dpy, \"WM_DELETE_WINDOW\", True);\n\tif (wm_delete_window != None) {\n\t\tXSetWMProtocols(x_dpy, win, &wm_delete_window, 1);\n\t}\n\n\tXMapWindow(x_dpy, win);\n\tif (!eglMakeCurrent(e_dpy, e_surf, e_surf, e_ctx)) {\n\t\tfprintf(stderr, \"eglMakeCurrent failed\\n\");","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/fyne-io/fyne/blob/8860ee95c356385effa5a7be51adb11c6be9d2b6/internal/driver/mobile/app/x11.c#L88-L124","documentation":"After opening the X display, x11.c calls eglGetDisplay(x_dpy) to obtain the EGL display for it. Returning EGL_NO_DISPLAY means the installed EGL could not adopt this X display: missing X11 EGL platform libraries, or an EGL stack that only supports other platforms (surfaceless, wayland, device). The process prints 'eglGetDisplay failed' and exits(1).","triggerScenarios":"eglGetDisplay on a valid X display failing because the X11 platform glue (libEGL_x11 / Mesa platform modules) is absent, EGL vendor libraries are misconfigured (glvnd ICDs), or EGL only supports Wayland/surfaceless on this install.","commonSituations":"Containers with libEGL but without libegl-mesa0/platform modules; Wayland-only stacks where X apps go through Xwayland but EGL vendor libs lack the x11 platform; broken glvnd configurations after partial driver installs.","solutions":["Install the Mesa X11 EGL platform pieces: apt install libegl1 libegl-mesa0 libglvnd0 libgl1-mesa-dri","Force platform selection: EGL_PLATFORM=x11 ./yourapp","Update Mesa/glvnd to repair ICD discovery (check /usr/share/glvnd/egl_vendor.d)","On Xwayland sessions, prefer running the Wayland-native path or full Mesa software rendering"],"exampleFix":"# before: EGL cannot adopt the X display\n./yourapp  # eglGetDisplay failed\n\n# after: install X11 EGL platform modules and pin the platform\nsudo apt install libegl1 libegl-mesa0 libglvnd0\nEGL_PLATFORM=x11 ./yourapp","handlingStrategy":"validation","validationCode":"func eglDisplayPreflight() error {\n\tif err := displayPreflight(); err != nil {\n\t\treturn err\n\t}\n\tif _, err := os.Stat(\"/usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0\"); err != nil {\n\t\treturn fmt.Errorf(\"Mesa X11 EGL platform missing; install libegl-mesa0 libglvnd0\")\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install libegl-mesa0 and glvnd components together with libEGL","Set EGL_PLATFORM=x11 explicitly in launch scripts","On Wayland-only hosts, install Xwayland plus the x11 EGL platform modules"],"tags":["c","egl","x11","glvnd","mesa","driver"],"backgroundTag":null,"analyzedSha":"8860ee95c356385effa5a7be51adb11c6be9d2b6","analyzedAt":"2026-08-15T22:01:51.624Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}