Skip to content

Commit

Permalink
gtk: mark Snapshot::to_(node|paintable) as nullable
Browse files Browse the repository at this point in the history
Fixes #845
  • Loading branch information
bilelmoussaoui committed Jan 24, 2022
1 parent 4b8185f commit 9953b7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions gtk4/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,12 @@ status = "generate"
[[object.function]]
name = "push_debug"
manual = true # ignore format args
[[object.function]]
# Drop once https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4413 is merged
# on the next gir-files update
pattern = "to_(node|paintable)"
[object.function.return]
nullable = true

[[object]]
name = "Gtk.SpinButton"
Expand Down
4 changes: 2 additions & 2 deletions gtk4/src/auto/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,12 @@ impl Snapshot {
}

#[doc(alias = "gtk_snapshot_to_node")]
pub fn to_node(&self) -> gsk::RenderNode {
pub fn to_node(&self) -> Option<gsk::RenderNode> {
unsafe { from_glib_full(ffi::gtk_snapshot_to_node(self.to_glib_none().0)) }
}

#[doc(alias = "gtk_snapshot_to_paintable")]
pub fn to_paintable(&self, size: Option<&graphene::Size>) -> gdk::Paintable {
pub fn to_paintable(&self, size: Option<&graphene::Size>) -> Option<gdk::Paintable> {
unsafe {
from_glib_full(ffi::gtk_snapshot_to_paintable(
self.to_glib_none().0,
Expand Down

0 comments on commit 9953b7c

Please sign in to comment.