Workaround for FileChooserNative oddness
This commit is contained in:
parent
cb4daa1ba1
commit
88e07031a6
@ -109,7 +109,6 @@ impl App {
|
|||||||
|
|
||||||
info!("Application is exiting");
|
info!("Application is exiting");
|
||||||
app.quit();
|
app.quit();
|
||||||
|
|
||||||
Inhibit(false)
|
Inhibit(false)
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -394,11 +393,17 @@ impl App {
|
|||||||
let weak = Rc::downgrade(&app);
|
let weak = Rc::downgrade(&app);
|
||||||
application.connect_activate(move |_| {
|
application.connect_activate(move |_| {
|
||||||
info!("GApplication::activate");
|
info!("GApplication::activate");
|
||||||
weak.upgrade().map(|app| app.window.activate());
|
if let Some(app) = weak.upgrade() {
|
||||||
|
// Ideally Gtk4/GtkBuilder make this irrelvent
|
||||||
|
app.window.show_all();
|
||||||
|
app.window.present();
|
||||||
|
info!("Window presented");
|
||||||
|
} else {
|
||||||
|
debug_assert!(false, "I hate computers");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
info!("Init complete");
|
info!("Init complete");
|
||||||
app.window.show_all();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -364,7 +364,7 @@ pub(crate) fn on_import_clicked(window: >k::ApplicationWindow, sender: &Sender
|
|||||||
filter.add_mime_type("text/xml");
|
filter.add_mime_type("text/xml");
|
||||||
dialog.add_filter(&filter);
|
dialog.add_filter(&filter);
|
||||||
|
|
||||||
dialog.connect_response(clone!(sender => move |dialog, resp| {
|
let resp = dialog.run();
|
||||||
debug!("Dialog Response {}", resp);
|
debug!("Dialog Response {}", resp);
|
||||||
if resp == ResponseType::Accept.to_glib() {
|
if resp == ResponseType::Accept.to_glib() {
|
||||||
if let Some(filename) = dialog.get_filename() {
|
if let Some(filename) = dialog.get_filename() {
|
||||||
@ -385,11 +385,6 @@ pub(crate) fn on_import_clicked(window: >k::ApplicationWindow, sender: &Sender
|
|||||||
sender.send(Action::ErrorNotification(text));
|
sender.send(Action::ErrorNotification(text));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.destroy();
|
|
||||||
}));
|
|
||||||
|
|
||||||
dialog.run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user