mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 21:11:00 +00:00
gtk4: Enable GtkGraphicsOffload::black-background property when building with GTK 4.16
This allows offloading in more situations. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/576 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1673>
This commit is contained in:
parent
5a1d12419f
commit
380448587b
3 changed files with 9 additions and 0 deletions
|
@ -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"
|
||||
|
|
|
@ -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"))]
|
||||
|
|
|
@ -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"))]
|
||||
|
|
Loading…
Reference in a new issue