Fix crash when adding an external editor

On some platforms, the app chooser dialog causes a crash after selecting
an application. The application information returned by the dialog may
also trigger crashes when accessed. See
https://gitlab.gnome.org/GNOME/glib/-/issues/1104 and
https://gitlab.gnome.org/GNOME/glibmm/-/issues/94. This commit overrides
gtkmm's app chooser dialog to work around these bugs.
This commit is contained in:
Lawrence Lee
2021-08-14 16:05:11 -07:00
parent 9423ebc97c
commit d3e524a491
7 changed files with 130 additions and 10 deletions

View File

@@ -164,7 +164,7 @@ Gtk::TreeViewColumn *ExternalEditorPreferences::makeCommandColumn()
}
void ExternalEditorPreferences::onAppChooserDialogResponse(
int response_id, Gtk::AppChooserDialog *dialog)
int response_id, RTAppChooserDialog *dialog)
{
switch (response_id) {
case Gtk::RESPONSE_OK:
@@ -190,7 +190,7 @@ void ExternalEditorPreferences::openAppChooserDialog()
return;
}
app_chooser_dialog.reset(new Gtk::AppChooserDialog("image/tiff"));
app_chooser_dialog.reset(new RTAppChooserDialog("image/tiff"));
app_chooser_dialog->signal_response().connect(sigc::bind(
sigc::mem_fun(*this, &ExternalEditorPreferences::onAppChooserDialogResponse),
app_chooser_dialog.get()