From aaaad3e8c193713f720833222b3e80eefbbd4332 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 1 Aug 2023 16:01:14 +0200 Subject: [PATCH] Adapt to addition of glib::Propagation --- examples/dialog/main.rs | 4 ++-- gdk4-x11/src/x11_display.rs | 4 ++-- gtk4/src/event_controller_key.rs | 4 ++-- gtk4/src/subclass/window.rs | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/dialog/main.rs b/examples/dialog/main.rs index bd462e751070..24dd82b03927 100644 --- a/examples/dialog/main.rs +++ b/examples/dialog/main.rs @@ -1,4 +1,4 @@ -use gtk::glib::{self, clone, ControlFlow}; +use gtk::glib::{self, clone}; use gtk::prelude::*; use std::rc::Rc; @@ -40,7 +40,7 @@ fn build_ui(application: >k::Application) { if let Some(application) = window.application() { application.remove_window(window); } - ControlFlow::Break + glib::Propagation::Proceed }); } diff --git a/gdk4-x11/src/x11_display.rs b/gdk4-x11/src/x11_display.rs index 60a13e9c6527..b0718acd4d0b 100644 --- a/gdk4-x11/src/x11_display.rs +++ b/gdk4-x11/src/x11_display.rs @@ -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 glib::ControlFlow + 'static>( + pub unsafe fn connect_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, diff --git a/gtk4/src/event_controller_key.rs b/gtk4/src/event_controller_key.rs index dcb1f3b35656..76b138c5e821 100644 --- a/gtk4/src/event_controller_key.rs +++ b/gtk4/src/event_controller_key.rs @@ -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, diff --git a/gtk4/src/subclass/window.rs b/gtk4/src/subclass/window.rs index 9fa1a27d3025..7cb511c8f367 100644 --- a/gtk4/src/subclass/window.rs +++ b/gtk4/src/subclass/window.rs @@ -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() } } @@ -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::().to_glib_none().0)) + glib::Propagation::from_glib(f(self.obj().unsafe_cast_ref::().to_glib_none().0)) } } }