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

Commit d33c198

Browse files
pborbilelmoussaoui
authored andcommitted
Properly use the Propagation values
In the shuffle from Inhibit(bool), to ControlFlow, to Propagtaion we ended up flipping some value. In particular in the widget subclass code and in the example.
1 parent 3ec2253 commit d33c198

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

examples/cairo_test/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn build_ui(application: &gtk::Application) {
5757
cr.arc(0.5 + eye_dx, eye_y, 0.05, 0.0, PI * 2.);
5858
cr.fill().expect("Invalid cairo surface state");
5959

60-
glib::Propagation::Stop
60+
glib::Propagation::Proceed
6161
});
6262

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

85-
glib::Propagation::Stop
85+
glib::Propagation::Proceed
8686
});
8787
}
8888

examples/cairo_threads/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn build_ui(application: &gtk::Application) {
104104
// Whenever the drawing area has to be redrawn, render the latest images in the correct
105105
// locations
106106
area.connect_draw(
107-
glib::clone!(@weak workspace => @default-return glib::Propagation::Stop, move |_, cr| {
107+
glib::clone!(@weak workspace => @default-return glib::Propagation::Proceed, move |_, cr| {
108108
let (ref images, ref origins, _) = *workspace;
109109

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

116-
glib::Propagation::Stop
116+
glib::Propagation::Proceed
117117
}),
118118
);
119119

examples/clipboard_simple/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn build_ui(application: &gtk::Application) {
2222
window.set_title("gtk::Clipboard Simple Example");
2323
window.connect_delete_event(|window, _| {
2424
window.close();
25-
glib::Propagation::Stop
25+
glib::Propagation::Proceed
2626
});
2727

2828
// Create the button grid

examples/gtk_builder_basics/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn build_ui(application: &gtk::Application) {
2626

2727
dialog.connect_delete_event(|dialog, _| {
2828
dialog.hide();
29-
glib::Propagation::Proceed
29+
glib::Propagation::Stop
3030
});
3131

3232
bigbutton.connect_clicked(glib::clone!(@weak dialog => move |_| dialog.show_all()));

examples/gtk_builder_signal/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn build_ui(application: &gtk::Application) {
1414
.expect("Couldn't get messagedialog1");
1515
dialog.connect_delete_event(|dialog, _| {
1616
dialog.hide();
17-
glib::Propagation::Proceed
17+
glib::Propagation::Stop
1818
});
1919

2020
builder.connect_signals(move |_, handler_name| {

examples/gtk_test/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn build_ui(application: &gtk::Application) {
155155
button_about.connect_clicked(move |x| about_clicked(x, &dialog));
156156

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

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

169-
glib::Propagation::Stop
169+
glib::Propagation::Proceed
170170
}),
171171
);
172172

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

188188
println!("Authors: {:?}", dialog.authors());

examples/multi_window/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ fn create_sub_window(
9898
window.set_default_size(400, 200);
9999

100100
window.connect_delete_event(
101-
glib::clone!(@weak windows => @default-return glib::Propagation::Stop, move |_, _| {
101+
glib::clone!(@weak windows => @default-return glib::Propagation::Proceed, move |_, _| {
102102
windows.borrow_mut().remove(&id);
103-
glib::Propagation::Stop
103+
glib::Propagation::Proceed
104104
}),
105105
);
106106

examples/progress_tracker/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Widgets {
130130
window.set_default_size(500, 250);
131131
window.connect_delete_event(move |window, _| {
132132
window.close();
133-
glib::Propagation::Stop
133+
glib::Propagation::Proceed
134134
});
135135

136136
Self {

examples/transparent_main_window/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ fn draw(_window: &ApplicationWindow, ctx: &cairo::Context) -> glib::Propagation
4646
ctx.set_source_rgba(1.0, 0.0, 0.0, 0.4);
4747
ctx.set_operator(cairo::Operator::Screen);
4848
ctx.paint().expect("Invalid cairo surface state");
49-
glib::Propagation::Stop
49+
glib::Propagation::Proceed
5050
}

gtk/src/subclass/socket.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub trait SocketImplExt: ObjectSubclass + sealed::Sealed {
4545
.to_glib_none()
4646
.0))
4747
} else {
48-
glib::Propagation::Stop
48+
glib::Propagation::Proceed
4949
}
5050
}
5151
}

gtk/src/subclass/widget.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
319319
ev_glib,
320320
))
321321
} else {
322-
Propagation::Stop
322+
Propagation::Proceed
323323
}
324324
}
325325
}
@@ -334,7 +334,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
334334
ev_glib,
335335
))
336336
} else {
337-
Propagation::Stop
337+
Propagation::Proceed
338338
}
339339
}
340340
}
@@ -391,7 +391,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
391391
ev_glib,
392392
))
393393
} else {
394-
Propagation::Stop
394+
Propagation::Proceed
395395
}
396396
}
397397
}
@@ -406,7 +406,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
406406
ev_glib,
407407
))
408408
} else {
409-
Propagation::Stop
409+
Propagation::Proceed
410410
}
411411
}
412412
}
@@ -421,7 +421,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
421421
ev_glib,
422422
))
423423
} else {
424-
Propagation::Stop
424+
Propagation::Proceed
425425
}
426426
}
427427
}
@@ -436,7 +436,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
436436
ev_glib,
437437
))
438438
} else {
439-
Propagation::Stop
439+
Propagation::Proceed
440440
}
441441
}
442442
}
@@ -460,7 +460,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
460460
ev_glib,
461461
))
462462
} else {
463-
Propagation::Stop
463+
Propagation::Proceed
464464
}
465465
}
466466
}
@@ -587,7 +587,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
587587
time,
588588
))
589589
} else {
590-
Propagation::Stop
590+
Propagation::Proceed
591591
}
592592
}
593593
}
@@ -614,7 +614,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
614614
result.into_glib(),
615615
))
616616
} else {
617-
Propagation::Stop
617+
Propagation::Proceed
618618
}
619619
}
620620
}
@@ -650,7 +650,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
650650
time,
651651
))
652652
} else {
653-
Propagation::Stop
653+
Propagation::Proceed
654654
}
655655
}
656656
}
@@ -664,7 +664,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
664664
cr.to_glib_none().0,
665665
))
666666
} else {
667-
Propagation::Stop
667+
Propagation::Proceed
668668
}
669669
}
670670
}
@@ -799,7 +799,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
799799
mut_override(event.to_glib_none().0),
800800
))
801801
} else {
802-
Propagation::Stop
802+
Propagation::Proceed
803803
}
804804
}
805805
}
@@ -813,7 +813,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
813813
mut_override(event.to_glib_none().0),
814814
))
815815
} else {
816-
Propagation::Stop
816+
Propagation::Proceed
817817
}
818818
}
819819
}
@@ -827,7 +827,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
827827
mut_override(event.to_glib_none().0),
828828
))
829829
} else {
830-
Propagation::Stop
830+
Propagation::Proceed
831831
}
832832
}
833833
}
@@ -841,7 +841,7 @@ pub trait WidgetImplExt: ObjectSubclass + sealed::Sealed {
841841
mut_override(event.to_glib_none().0),
842842
))
843843
} else {
844-
Propagation::Stop
844+
Propagation::Proceed
845845
}
846846
}
847847
}

0 commit comments

Comments
 (0)