diff --git a/video/gtk4/Cargo.toml b/video/gtk4/Cargo.toml index e7ee030d9..d25b89e45 100644 --- a/video/gtk4/Cargo.toml +++ b/video/gtk4/Cargo.toml @@ -57,6 +57,7 @@ doc = ["gst/v1_18"] gtk_v4_10 = ["gtk/v4_10"] gtk_v4_12 = ["gtk/v4_12", "gtk_v4_10"] gtk_v4_14 = ["gtk/v4_14", "gtk_v4_12"] +gtk_v4_16 = ["gtk/v4_16", "gtk_v4_14"] [package.metadata.capi] min_version = "0.9.21" diff --git a/video/gtk4/examples/gtksink.rs b/video/gtk4/examples/gtksink.rs index abda23c66..f200ede51 100644 --- a/video/gtk4/examples/gtksink.rs +++ b/video/gtk4/examples/gtksink.rs @@ -69,6 +69,10 @@ fn create_ui(app: >k::Application) { { let offload = gtk::GraphicsOffload::new(Some(&picture)); offload.set_enabled(gtk::GraphicsOffloadEnabled::Enabled); + #[cfg(feature = "gtk_v4_16")] + { + offload.set_black_background(true); + } vbox.append(&offload); } #[cfg(not(feature = "gtk_v4_14"))] diff --git a/video/gtk4/src/sink/imp.rs b/video/gtk4/src/sink/imp.rs index 1af37b19a..4e397a9c4 100644 --- a/video/gtk4/src/sink/imp.rs +++ b/video/gtk4/src/sink/imp.rs @@ -762,6 +762,10 @@ impl PaintableSink { { let offload = gtk::GraphicsOffload::new(Some(&picture)); offload.set_enabled(gtk::GraphicsOffloadEnabled::Enabled); + #[cfg(feature = "gtk_v4_16")] + { + offload.set_black_background(true); + } window.set_child(Some(&offload)); } #[cfg(not(feature = "gtk_v4_14"))]