glcontext: Don't spew warnings on surfaceless contexts

Get the display directly instead of via the nonexisting surface.
This commit is contained in:
Benjamin Otte 2022-01-06 19:23:29 +01:00
parent 7872b41f16
commit 5dc940ead2

View File

@ -185,8 +185,7 @@ gdk_gl_context_dispose (GObject *gobject)
if (priv->egl_context != NULL)
{
GdkSurface *surface = gdk_gl_context_get_surface (context);
GdkDisplay *display = gdk_surface_get_display (surface);
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
EGLDisplay *egl_display = gdk_display_get_egl_display (display);
if (eglGetCurrentContext () == priv->egl_context)