Skip to content

Commit 3cce609

Browse files
gtk: mark Snapshot::to_(node|paintable) as nullable
Fixes #845
1 parent 3ee35e4 commit 3cce609

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

gtk4/Gir.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,12 @@ status = "generate"
18431843
[[object.function]]
18441844
name = "push_debug"
18451845
manual = true # ignore format args
1846+
[[object.function]]
1847+
# Drop once https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4413 is merged
1848+
# on the next gir-files update
1849+
pattern = "to_(node|paintable)"
1850+
[object.function.return]
1851+
nullable = true
18461852

18471853
[[object]]
18481854
name = "Gtk.SpinButton"

gtk4/src/auto/snapshot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,12 @@ impl Snapshot {
502502
}
503503

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

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

0 commit comments

Comments
 (0)