Skip to content

Commit 120e9bd

Browse files
sdroegebilelmoussaoui
authored andcommitted
Regenerate with latest gir
1 parent f22aebb commit 120e9bd

File tree

12 files changed

+40
-27
lines changed

12 files changed

+40
-27
lines changed

gdk4-wayland/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

gdk4-wayland/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

gdk4-x11/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

gdk4-x11/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

gdk4/src/auto/content_provider.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub trait ContentProviderExt: 'static {
7575
fn storable_formats(&self) -> ContentFormats;
7676

7777
#[doc(alias = "gdk_content_provider_write_mime_type_async")]
78-
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + Send + 'static>(
78+
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + 'static>(
7979
&self,
8080
mime_type: &str,
8181
stream: &impl IsA<gio::OutputStream>,
@@ -124,17 +124,28 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
124124
}
125125
}
126126

127-
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + Send + 'static>(
127+
fn write_mime_type_async<P: FnOnce(Result<(), glib::Error>) + 'static>(
128128
&self,
129129
mime_type: &str,
130130
stream: &impl IsA<gio::OutputStream>,
131131
io_priority: glib::Priority,
132132
cancellable: Option<&impl IsA<gio::Cancellable>>,
133133
callback: P,
134134
) {
135-
let user_data: Box_<P> = Box_::new(callback);
135+
let main_context = glib::MainContext::ref_thread_default();
136+
let is_main_context_owner = main_context.is_owner();
137+
let has_acquired_main_context = (!is_main_context_owner)
138+
.then(|| main_context.acquire().ok())
139+
.flatten();
140+
assert!(
141+
is_main_context_owner || has_acquired_main_context.is_some(),
142+
"Async operations only allowed if the thread is owning the MainContext"
143+
);
144+
145+
let user_data: Box_<glib::thread_guard::ThreadGuard<P>> =
146+
Box_::new(glib::thread_guard::ThreadGuard::new(callback));
136147
unsafe extern "C" fn write_mime_type_async_trampoline<
137-
P: FnOnce(Result<(), glib::Error>) + Send + 'static,
148+
P: FnOnce(Result<(), glib::Error>) + 'static,
138149
>(
139150
_source_object: *mut glib::gobject_ffi::GObject,
140151
res: *mut gio::ffi::GAsyncResult,
@@ -151,7 +162,9 @@ impl<O: IsA<ContentProvider>> ContentProviderExt for O {
151162
} else {
152163
Err(from_glib_full(error))
153164
};
154-
let callback: Box_<P> = Box_::from_raw(user_data as *mut _);
165+
let callback: Box_<glib::thread_guard::ThreadGuard<P>> =
166+
Box_::from_raw(user_data as *mut _);
167+
let callback: P = callback.into_inner();
155168
callback(result);
156169
}
157170
let callback = write_mime_type_async_trampoline::<P>;

gdk4/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

gdk4/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

gsk4/src/auto/transform.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Transform {
4949

5050
#[doc(alias = "gsk_transform_matrix")]
5151
#[must_use]
52-
pub fn matrix(&self, matrix: &graphene::Matrix) -> Option<Transform> {
52+
pub fn matrix(&self, matrix: &graphene::Matrix) -> Transform {
5353
unsafe {
5454
from_glib_full(ffi::gsk_transform_matrix(
5555
self.to_glib_full(),
@@ -60,7 +60,7 @@ impl Transform {
6060

6161
#[doc(alias = "gsk_transform_perspective")]
6262
#[must_use]
63-
pub fn perspective(&self, depth: f32) -> Option<Transform> {
63+
pub fn perspective(&self, depth: f32) -> Transform {
6464
unsafe { from_glib_full(ffi::gsk_transform_perspective(self.to_glib_full(), depth)) }
6565
}
6666

gsk4/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

gsk4/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ ee37253c10af)
2-
from gir-files (https://github.com/gtk-rs/gir-files.git @ 5264fd0c3183)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 78e3d3c22343)
2+
from gir-files (https://github.com/gtk-rs/gir-files.git @ 3ff4d3275258)

0 commit comments

Comments
 (0)