Skip to content

Commit

Permalink
gtk: Don't propogate unused argument
Browse files Browse the repository at this point in the history
Unlike the C version we are emulating, we dont set any ‘arguments’, and
in any case they have little value in a language with native closures

It's therefore plain confusing to require users to accept this second
parameter that will *always* be `None`

Fix: #1590
See: #1542
  • Loading branch information
ZanderBrown authored and bilelmoussaoui committed Feb 4, 2024
1 parent ef50ef8 commit a4b53e3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions gtk4/src/subclass/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,11 +1008,7 @@ pub unsafe trait WidgetClassExt: ClassStruct {

#[doc(alias = "gtk_widget_class_add_binding")]
fn add_binding<
F: Fn(
&<<Self as ClassStruct>::Type as ObjectSubclass>::Type,
Option<&Variant>,
) -> glib::Propagation
+ 'static,
F: Fn(&<<Self as ClassStruct>::Type as ObjectSubclass>::Type) -> glib::Propagation + 'static,
>(
&mut self,
keyval: gdk::Key,
Expand All @@ -1022,8 +1018,8 @@ pub unsafe trait WidgetClassExt: ClassStruct {
let shortcut = crate::Shortcut::new(
Some(crate::KeyvalTrigger::new(keyval, mods)),
Some(crate::CallbackAction::new(
move |widget, args| -> glib::Propagation {
unsafe { callback(widget.unsafe_cast_ref(), args) }
move |widget, _| -> glib::Propagation {
unsafe { callback(widget.unsafe_cast_ref()) }
},
)),
);
Expand Down

0 comments on commit a4b53e3

Please sign in to comment.