Skip to content

Commit

Permalink
Adapt to addition of glib::Propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Aug 1, 2023
1 parent 1e92833 commit ee1da3b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/dialog/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gtk::glib::{self, clone, ControlFlow};
use gtk::glib::{self, clone};
use gtk::prelude::*;

use std::rc::Rc;
Expand Down Expand Up @@ -40,7 +40,7 @@ fn build_ui(application: &gtk::Application) {
if let Some(application) = window.application() {
application.remove_window(window);
}
ControlFlow::Break
glib::Propagation::Proceed
});
}

Expand Down
4 changes: 2 additions & 2 deletions gdk4-x11/src/x11_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ impl X11Display {
#[cfg(any(feature = "xlib", docsrs))]
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
#[doc(alias = "xevent")]
pub unsafe fn connect_xevent<F: Fn(&Self, *mut xlib::XEvent) -> glib::ControlFlow + 'static>(
pub unsafe fn connect_xevent<F: Fn(&Self, *mut xlib::XEvent) -> glib::Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn xevent_trampoline<
F: Fn(&X11Display, *mut xlib::XEvent) -> glib::ControlFlow + 'static,
F: Fn(&X11Display, *mut xlib::XEvent) -> glib::Propagation + 'static,
>(
this: *mut ffi::GdkX11Display,
xevent: glib::ffi::gpointer,
Expand Down
4 changes: 2 additions & 2 deletions gtk4/src/event_controller_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ use std::{boxed::Box as Box_, mem::transmute};

impl EventControllerKey {
pub fn connect_key_pressed<
F: Fn(&EventControllerKey, Key, u32, gdk::ModifierType) -> glib::ControlFlow + 'static,
F: Fn(&EventControllerKey, Key, u32, gdk::ModifierType) -> glib::Propagation + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn key_pressed_trampoline<
F: Fn(&EventControllerKey, Key, u32, gdk::ModifierType) -> glib::ControlFlow + 'static,
F: Fn(&EventControllerKey, Key, u32, gdk::ModifierType) -> glib::Propagation + 'static,
>(
this: *mut ffi::GtkEventControllerKey,
keyval: libc::c_uint,
Expand Down
6 changes: 3 additions & 3 deletions gtk4/src/subclass/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub trait WindowImpl: WindowImplExt + WidgetImpl {
self.parent_enable_debugging(toggle)
}

fn close_request(&self) -> glib::ControlFlow {
fn close_request(&self) -> glib::Propagation {
self.parent_close_request()
}
}
Expand Down Expand Up @@ -81,14 +81,14 @@ pub trait WindowImplExt: sealed::Sealed + ObjectSubclass {
}
}

fn parent_close_request(&self) -> glib::ControlFlow {
fn parent_close_request(&self) -> glib::Propagation {
unsafe {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GtkWindowClass;
let f = (*parent_class)
.close_request
.expect("No parent class impl for \"close_request\"");
glib::ControlFlow::from_glib(f(self.obj().unsafe_cast_ref::<Window>().to_glib_none().0))
glib::Propagation::from_glib(f(self.obj().unsafe_cast_ref::<Window>().to_glib_none().0))
}
}
}
Expand Down

0 comments on commit ee1da3b

Please sign in to comment.