diff --git a/Gir_GstGL.toml b/Gir_GstGL.toml
index 896f31b08..903de96b4 100644
--- a/Gir_GstGL.toml
+++ b/Gir_GstGL.toml
@@ -192,6 +192,12 @@ status = "generate"
final_type = true
cfg_condition = "feature = \"egl\""
+[[object]]
+name = "GstGL.GLDisplayX11"
+status = "generate"
+final_type = true
+cfg_condition = "feature = \"x11\""
+
[[object]]
name = "GstGL.GLWindow"
status = "generate"
diff --git a/gir-files/GstGL-1.0.gir b/gir-files/GstGL-1.0.gir
index e72653c4d..c7a90c57a 100644
--- a/gir-files/GstGL-1.0.gir
+++ b/gir-files/GstGL-1.0.gir
@@ -2658,8 +2658,67 @@ through the provided API
-
-
+
+ the contents of a #GstGLDisplayX11 are private and should only be accessed
+through the provided API
+
+ Create a new #GstGLDisplayX11 from the x11 display name. See XOpenDisplay()
+for details on what is a valid name.
+
+ a new #GstGLDisplayX11 or %NULL
+
+
+
+
+ a display name
+
+
+
+
+
+ Creates a new display connection from a X11 Display.
+
+ a new #GstGLDisplayX11
+
+
+
+
+ an existing, x11 display
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#GstGLFilter helps to implement simple OpenGL filter elements taking a
single input and producing a single output with a #GstGLFramebuffer
diff --git a/gir-files/fix.sh b/gir-files/fix.sh
index 9f3788827..a7ce4fe8e 100755
--- a/gir-files/fix.sh
+++ b/gir-files/fix.sh
@@ -33,11 +33,17 @@ xmlstarlet ed --pf --inplace \
--delete '//_:record[@name="GLDisplayWaylandClass"]' \
GstGL-1.0.gir
-# Remove GstDisplayX11
+# Change X11's Display* and xcb_connection_t* pointers to gpointer
xmlstarlet ed --pf --inplace \
- --delete '//_:class[@name="GLDisplayX11"]' \
- --delete '//_:record[@name="GLDisplayX11Class"]' \
- GstGL-1.0.gir
+ --insert '//_:type[@c:type="Display*"]' \
+ --type attr --name 'name' --value 'gpointer' \
+ --insert '//_:type[@c:type="xcb_connection_t*"]' \
+ --type attr --name 'name' --value 'gpointer' \
+ --update '//*[@c:type="Display*"]/@c:type' \
+ --value gpointer \
+ --update '//*[@c:type="xcb_connection_t*"]/@c:type' \
+ --value gpointer \
+ GstGL-1.0.gir
# Remove GstMemoryEGL
xmlstarlet ed --pf --inplace \
diff --git a/gstreamer-gl/Cargo.toml b/gstreamer-gl/Cargo.toml
index 9ce63a6d5..fe1e05594 100644
--- a/gstreamer-gl/Cargo.toml
+++ b/gstreamer-gl/Cargo.toml
@@ -37,5 +37,6 @@ optional = true
default = []
dox = ["gstreamer-gl-sys/dox", "glib/dox", "gstreamer/dox", "gstreamer-base/dox"]
egl = ["gstreamer-gl-sys/egl"]
+x11 = ["gstreamer-gl-sys/x11"]
embed-lgpl-docs = ["rustdoc-stripper"]
purge-lgpl-docs = ["rustdoc-stripper"]
diff --git a/gstreamer-gl/src/auto/gl_display_x11.rs b/gstreamer-gl/src/auto/gl_display_x11.rs
new file mode 100644
index 000000000..556cc7dd0
--- /dev/null
+++ b/gstreamer-gl/src/auto/gl_display_x11.rs
@@ -0,0 +1,33 @@
+// This file was generated by gir (https://github.com/gtk-rs/gir)
+// from gir-files (https://github.com/gtk-rs/gir-files)
+// DO NOT EDIT
+
+use GLDisplay;
+use ffi;
+use glib::translate::*;
+use gst;
+
+glib_wrapper! {
+ pub struct GLDisplayX11(Object) @extends GLDisplay, gst::Object;
+
+ match fn {
+ get_type => || ffi::gst_gl_display_x11_get_type(),
+ }
+}
+
+impl GLDisplayX11 {
+ pub fn new<'a, P: Into