File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,27 @@ unsafe impl<T: GtkApplicationImpl> IsSubclassable<T> for Application {
60
60
<gio:: Application as IsSubclassable < T > >:: override_vfuncs ( class) ;
61
61
62
62
let klass = class. as_mut ( ) ;
63
+
63
64
klass. window_added = Some ( application_window_added :: < T > ) ;
64
65
klass. window_removed = Some ( application_window_removed :: < T > ) ;
66
+
67
+ // Chain our startup handler in here
68
+ let parent_klass = & mut class. as_mut ( ) . parent_class ;
69
+ parent_klass. startup = Some ( application_startup :: < T > ) ;
65
70
}
66
71
}
67
72
73
+ unsafe extern "C" fn application_startup < T : ObjectSubclass > ( ptr : * mut gio:: ffi:: GApplication )
74
+ where
75
+ T : GtkApplicationImpl ,
76
+ {
77
+ let instance = & * ( ptr as * mut T :: Instance ) ;
78
+ let imp = instance. get_impl ( ) ;
79
+ let wrap: Borrowed < gio:: Application > = from_glib_borrow ( ptr) ;
80
+ crate :: rt:: set_initialized ( ) ;
81
+ imp. startup ( wrap. unsafe_cast_ref ( ) )
82
+ }
83
+
68
84
unsafe extern "C" fn application_window_added < T : GtkApplicationImpl > (
69
85
ptr : * mut ffi:: GtkApplication ,
70
86
wptr : * mut ffi:: GtkWindow ,
You can’t perform that action at this time.
0 commit comments