Skip to content

Commit 2c6951c

Browse files
authored
Fix #597: The edit button is disabled
For some reason due to Glib::IO::AppInfo::get_recommended_for_type failing to determine recommended apps for the "Open with" menu switching the edit button to sensitive fails. Checking $apps for being undefinied leaves the user without apps in the "Open with" menu but keeps the edit button enabled.
1 parent 154d9a1 commit 2c6951c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/shutter

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8653,6 +8653,11 @@ sub STARTUP {
86538653
# https://developer.gnome.org/gio/stable/GAppInfo.html
86548654
my $apps = Glib::IO::AppInfo::get_recommended_for_type($mime_type);
86558655

8656+
# $apps is undefined if Glib::IO::AppInfo::get_recommended_for_type fails
8657+
unless (defined $apps) {
8658+
return $menu_programs;
8659+
}
8660+
86568661
#no apps determined!
86578662
unless (scalar @$apps) {
86588663
$sm->{_menuitem_reopen}->set_sensitive(FALSE);

0 commit comments

Comments
 (0)