diff options
author | Colomban Wendling <[email protected]> | 2020-08-04 15:57:04 +0200 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2020-08-04 18:19:56 +0200 |
commit | ecfe8a9e7ed519b11bd1d13f5e7e8d29ef71512d (patch) | |
tree | 8eee16a388ca8fda8702f346e75eda3e78d0fbe5 | |
parent | eace4fe6ab55b795b9648fc5f64ada6e2baa8baf (diff) | |
download | mate-panel-ecfe8a9e7ed519b11bd1d13f5e7e8d29ef71512d.tar.bz2 mate-panel-ecfe8a9e7ed519b11bd1d13f5e7e8d29ef71512d.tar.xz |
Create launchers when dropping multiple image URIs
It doesn't make any sense to set the panel's background several times
if we get multiple image URIs dropped, so don't consider multi-URI
drops as candidate for setting the background, and handle those like
other non-image URIs.
-rw-r--r-- | mate-panel/panel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mate-panel/panel.c b/mate-panel/panel.c index 67bd7689..8bd84acd 100644 --- a/mate-panel/panel.c +++ b/mate-panel/panel.c @@ -604,10 +604,12 @@ drop_urilist (PanelWidget *panel, char *urilist) { char **uris; + guint n_uris; gboolean success; int i; uris = g_uri_list_extract_uris (urilist); + n_uris = g_strv_length (uris); success = TRUE; for (i = 0; uris[i]; i++) { @@ -657,8 +659,8 @@ drop_urilist (PanelWidget *panel, can_exec = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE); - if (mime && - g_str_has_prefix (mime, "image")) { + if (n_uris == 1 && + mime && g_str_has_prefix (mime, "image")) { if (!set_background_image_from_uri (panel->toplevel, uri)) success = FALSE; } else if (mime && |