Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Properly use the Propagation values #845

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/cairo_test/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn build_ui(application: &gtk::Application) {
cr.arc(0.5 + eye_dx, eye_y, 0.05, 0.0, PI * 2.);
cr.fill().expect("Invalid cairo surface state");

glib::Propagation::Stop
glib::Propagation::Proceed
});

drawable(application, 500, 500, |_, cr| {
Expand All @@ -82,7 +82,7 @@ fn build_ui(application: &gtk::Application) {
cr.arc(0.27, 0.65, 0.02, 0.0, PI * 2.);
cr.fill().expect("Invalid cairo surface state");

glib::Propagation::Stop
glib::Propagation::Proceed
});
}

Expand Down
4 changes: 2 additions & 2 deletions examples/cairo_threads/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn build_ui(application: &gtk::Application) {
// Whenever the drawing area has to be redrawn, render the latest images in the correct
// locations
area.connect_draw(
glib::clone!(@weak workspace => @default-return glib::Propagation::Stop, move |_, cr| {
glib::clone!(@weak workspace => @default-return glib::Propagation::Proceed, move |_, cr| {
let (ref images, ref origins, _) = *workspace;

for (image, origin) in images.iter().zip(origins.iter()) {
Expand All @@ -113,7 +113,7 @@ fn build_ui(application: &gtk::Application) {
});
}

glib::Propagation::Stop
glib::Propagation::Proceed
}),
);

Expand Down
2 changes: 1 addition & 1 deletion examples/clipboard_simple/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn build_ui(application: &gtk::Application) {
window.set_title("gtk::Clipboard Simple Example");
window.connect_delete_event(|window, _| {
window.close();
glib::Propagation::Stop
glib::Propagation::Proceed
});

// Create the button grid
Expand Down
2 changes: 1 addition & 1 deletion examples/gtk_builder_basics/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn build_ui(application: &gtk::Application) {

dialog.connect_delete_event(|dialog, _| {
dialog.hide();
glib::Propagation::Proceed
glib::Propagation::Stop
});

bigbutton.connect_clicked(glib::clone!(@weak dialog => move |_| dialog.show_all()));
Expand Down
2 changes: 1 addition & 1 deletion examples/gtk_builder_signal/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn build_ui(application: &gtk::Application) {
.expect("Couldn't get messagedialog1");
dialog.connect_delete_event(|dialog, _| {
dialog.hide();
glib::Propagation::Proceed
glib::Propagation::Stop
});

builder.connect_signals(move |_, handler_name| {
Expand Down
6 changes: 3 additions & 3 deletions examples/gtk_test/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn build_ui(application: &gtk::Application) {
button_about.connect_clicked(move |x| about_clicked(x, &dialog));

window.connect_key_press_event(
glib::clone!(@weak entry => @default-return glib::Propagation::Stop, move |_, key| {
glib::clone!(@weak entry => @default-return glib::Propagation::Proceed, move |_, key| {
let keyval = key.keyval();
let keystate = key.state();

Expand All @@ -166,7 +166,7 @@ fn build_ui(application: &gtk::Application) {
println!("You pressed Ctrl!");
}

glib::Propagation::Stop
glib::Propagation::Proceed
}),
);

Expand All @@ -182,7 +182,7 @@ fn about_clicked(button: &Button, dialog: &AboutDialog) {
// as otherwise we can't show it again a second time.
dialog.connect_delete_event(|dialog, _| {
dialog.hide();
glib::Propagation::Proceed
glib::Propagation::Stop
});

println!("Authors: {:?}", dialog.authors());
Expand Down
4 changes: 2 additions & 2 deletions examples/multi_window/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ fn create_sub_window(
window.set_default_size(400, 200);

window.connect_delete_event(
glib::clone!(@weak windows => @default-return glib::Propagation::Stop, move |_, _| {
glib::clone!(@weak windows => @default-return glib::Propagation::Proceed, move |_, _| {
windows.borrow_mut().remove(&id);
glib::Propagation::Stop
glib::Propagation::Proceed
}),
);

Expand Down
2 changes: 1 addition & 1 deletion examples/progress_tracker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Widgets {
window.set_default_size(500, 250);
window.connect_delete_event(move |window, _| {
window.close();
glib::Propagation::Stop
glib::Propagation::Proceed
});

Self {
Expand Down
2 changes: 1 addition & 1 deletion examples/transparent_main_window/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ fn draw(_window: &ApplicationWindow, ctx: &cairo::Context) -> glib::Propagation
ctx.set_source_rgba(1.0, 0.0, 0.0, 0.4);
ctx.set_operator(cairo::Operator::Screen);
ctx.paint().expect("Invalid cairo surface state");
glib::Propagation::Stop
glib::Propagation::Proceed
}
2 changes: 1 addition & 1 deletion gtk/src/subclass/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub trait SocketImplExt: ObjectSubclass + sealed::Sealed {
.to_glib_none()
.0))
} else {
glib::Propagation::Stop
glib::Propagation::Proceed
}
}
}
Expand Down
30 changes: 15 additions & 15 deletions gtk/src/subclass/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
ev_glib,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -334,7 +334,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
ev_glib,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand Down Expand Up @@ -391,7 +391,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
ev_glib,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -406,7 +406,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
ev_glib,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -421,7 +421,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
ev_glib,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -436,7 +436,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
ev_glib,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -460,7 +460,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
ev_glib,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand Down Expand Up @@ -587,7 +587,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
time,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -614,7 +614,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
result.into_glib(),
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand Down Expand Up @@ -650,7 +650,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
time,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -664,7 +664,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
cr.to_glib_none().0,
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand Down Expand Up @@ -799,7 +799,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
mut_override(event.to_glib_none().0),
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -813,7 +813,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
mut_override(event.to_glib_none().0),
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -827,7 +827,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
mut_override(event.to_glib_none().0),
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand All @@ -841,7 +841,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
mut_override(event.to_glib_none().0),
))
} else {
Propagation::Stop
Propagation::Proceed
}
}
}
Expand Down
Loading