File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,19 @@ impl<W: glib::IsA<gtk::Widget>> SpawnWithToast for W {
3030 . ancestor ( adw:: ToastOverlay :: static_type ( ) )
3131 . and_downcast ( ) ;
3232 let win: Option < NotifyWindow > = self . ancestor ( NotifyWindow :: static_type ( ) ) . and_downcast ( ) ;
33- glib:: MainContext :: default ( ) . spawn_local ( async move {
34- if let Err ( e) = f. await {
35- if let Some ( o) = toast_overlay
36- . as_ref ( )
37- . or_else ( || win. as_ref ( ) . map ( |win| win. imp ( ) . toast_overlay . as_ref ( ) ) )
38- {
39- o. add_toast ( adw:: Toast :: builder ( ) . title ( & e. to_string ( ) ) . build ( ) )
33+ glib:: MainContext :: ref_thread_default ( ) . spawn_local_with_priority (
34+ glib:: Priority :: DEFAULT_IDLE ,
35+ async move {
36+ if let Err ( e) = f. await {
37+ if let Some ( o) = toast_overlay
38+ . as_ref ( )
39+ . or_else ( || win. as_ref ( ) . map ( |win| win. imp ( ) . toast_overlay . as_ref ( ) ) )
40+ {
41+ o. add_toast ( adw:: Toast :: builder ( ) . title ( & e. to_string ( ) ) . build ( ) )
42+ }
4043 }
41- }
42- } ) ;
44+ } ,
45+ ) ;
4346 }
4447}
4548
You can’t perform that action at this time.
0 commit comments