Skip to content

Commit 8b9cdfc

Browse files
committed
nemo-mime-actions.c: Only add entire view file list to an image
viewer launch if its commandline supports multiple files. As a result of #2705, when a single image file is selected and launched, the full file list for the current directory is appended for certain viewers. This is a problem if the viewer's desktop file Exec line doesn't support multiple files, as it can cause multiple instances of a program to launch when that was not the intent. Only apply this new behavior if the Exec line accepts multiple files (%U and %F). ref: #2771
1 parent 5f10ff1 commit 8b9cdfc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libnemo-private/org.nemo.gschema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
<key name="image-viewers-with-external-sort" type="as">
211211
<default>['xviewer','feh','sxiv']</default>
212212
<summary>Image viewer executables to pass sort order to</summary>
213-
<description>When opening a single image with an application in this list, allow that viewer to display other images in the current nemo view, in the presented order (including searches). Other image viewers can be added, but are likely to ignore the order.</description>
213+
<description>When opening a single image with an application in this list, allow that viewer to display other images in the current nemo view, in the presented order (including searches). Other image viewers can be added, but are likely to ignore the order. The viewer Exec line must accept a list of files (either %U or %F).</description>
214214
</key>
215215
<key name="mouse-use-extra-buttons" type="b">
216216
<default>true</default>

src/nemo-mime-actions.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,9 +1491,12 @@ launch_application (GAppInfo *application,
14911491
{
14921492
NemoFile *single_file;
14931493
char **sortable_image_viewers;
1494+
gboolean accepts_uri_list;
14941495

1495-
if (uris != NULL && uris->next == NULL) {
1496+
accepts_uri_list = g_strstr_len (g_app_info_get_commandline (application), -1, "%F") ||
1497+
g_strstr_len (g_app_info_get_commandline (application), -1, "%U");
14961498

1499+
if (uris != NULL && uris->next == NULL && accepts_uri_list) {
14971500
sortable_image_viewers = g_settings_get_strv (nemo_preferences,
14981501
NEMO_PREFERENCES_IMAGE_VIEWERS_WITH_EXTERNAL_SORT);
14991502

0 commit comments

Comments
 (0)