diff --git a/src/xpra/x11/gtk2/gdk_display_source.pyx b/src/xpra/x11/gtk2/gdk_display_source.pyx index 578403d040..a51fc8651b 100644 --- a/src/xpra/x11/gtk2/gdk_display_source.pyx +++ b/src/xpra/x11/gtk2/gdk_display_source.pyx @@ -72,6 +72,8 @@ display = None ###### def init_gdk_display_source(): global display + if display: + return cdef cGdkDisplay* gdk_display cdef Display * x11_display if not gdk.display_get_default(): diff --git a/src/xpra/x11/gtk3/gdk_display_source.pyx b/src/xpra/x11/gtk3/gdk_display_source.pyx index 8395b59cce..745ec9d8a6 100644 --- a/src/xpra/x11/gtk3/gdk_display_source.pyx +++ b/src/xpra/x11/gtk3/gdk_display_source.pyx @@ -47,6 +47,8 @@ def init_gdk_display_source(): if not is_X11(): from xpra.scripts.config import InitException raise InitException("cannot use X11 bindings with Wayland and GTK3 (buggy)") + if display: + return cdef GdkDisplay* gdk_display cdef Display * x11_display #from gi.repository import GdkX11