After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676128 - Use Image as Background opens image in Eye of GNOME
Use Image as Background opens image in Eye of GNOME
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks: 678135
 
 
Reported: 2012-05-15 20:47 UTC by Adam Dingle
Modified: 2012-06-23 00:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
popup-commands: make bg img download action none (849 bytes, patch)
2012-05-24 17:40 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review
ephy-download: add EPHY_DOWNLOAD_ACTION_DO_NOTHING (2.29 KB, patch)
2012-06-01 02:48 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review
popup-commands: use EPHY_DOWNLOAD_ACTION_DO_NOTHING (926 bytes, patch)
2012-06-01 02:49 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review

Description Adam Dingle 2012-05-15 20:47:21 UTC
I'm running Epiphany from git master on Debian unstable.

This bug occurs only when the preference "Automatically open downloaded files" is checked.  If I right click an image in Epiphany and choose Use Image as Background, the image is both set as my desktop background and is also, unexpectedly, opened in the default image viewer (Eye of GNOME).
Comment 1 Xan Lopez 2012-05-24 09:20:07 UTC
So, this is not a bug in the sense that it's "working as implemented". If that preference is set every time a file is downloaded it will be opened if possible. I think it makes sense that when an action is defined for the file (like setting as background), also opening makes not much sense even if the preference is set, but this would require some changes in EphyDownload.
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2012-05-24 17:40:39 UTC
Created attachment 214882 [details] [review]
popup-commands: make bg img download action none
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2012-05-24 17:43:23 UTC
I could not reproduce. But the patch should make sense anyway. Could you test?

Also, I am not changing the behavior of other EphyDownload objects in popup-commands (save as, save image, download link) because I consider those are explicit download actions.

It might be a good time to add that I don't like auto-open-downloads very much.
Comment 4 Claudio Saavedra 2012-05-24 22:38:00 UTC
(In reply to comment #3)
> 
> It might be a good time to add that I don't like auto-open-downloads very much.

Neither do I, for what is worth.
Comment 5 Xan Lopez 2012-05-25 02:30:20 UTC
(In reply to comment #3)
> I could not reproduce. But the patch should make sense anyway. Could you test?
> 
> Also, I am not changing the behavior of other EphyDownload objects in
> popup-commands (save as, save image, download link) because I consider those
> are explicit download actions.

So, without testing your patch, this is the reason why I thought we needed to change stuff in EphyDownload:

When a download is finished download_status_change_cb calls do_download_action with two possible values:
- if EPHY_PREFS_AUTO_DOWNLOADS is set, AUTO
- Otherwise NONE

The latter is clearly OK wrt this bug, so our issue is the former. If do_download_action is called with AUTO, the code will do an action decided from the mime type of the download, so the action that you passed as set_action will be ignored. The only way to make do_download_action use the action you set through set_action is to pass NONE in do_download_action (per line 645 in ephy-download.c).

So I think what's needed here is some API that says "no really, do nothing for this download when it's done, even if the preference for AUTO_DOWNLOADS" is true.

Perhaps you cannot repro this bug because the preference is not set for you, so try that out first.

PS: I'm debugging this thing in my head, maybe I'm wrong, so clarifications welcome.

> 
> It might be a good time to add that I don't like auto-open-downloads very much.
Comment 6 Xan Lopez 2012-05-25 02:49:41 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > 
> > It might be a good time to add that I don't like auto-open-downloads very much.
> 
> Neither do I, for what is worth.

I suggest we have this debate here: https://bugzilla.gnome.org/show_bug.cgi?id=675854

In particular we need reasons to change our default value for the setting (hopefully other than 'Browser X does it like that')
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2012-06-01 02:48:57 UTC
Created attachment 215377 [details] [review]
ephy-download: add EPHY_DOWNLOAD_ACTION_DO_NOTHING

Add a new action instead of abusing NONE. NONE means nothing has been
set, this will trigger AUTO when auto-downloads preference is TRUE.

DO_NOTHING explicitely asks for no action to be taken.
Comment 8 Diego Escalante Urrelo (not reading bugmail) 2012-06-01 02:49:02 UTC
Created attachment 215378 [details] [review]
popup-commands: use EPHY_DOWNLOAD_ACTION_DO_NOTHING

Stop downloaded backgrounds from popping an image viewer instance.
Comment 9 Adam Dingle 2012-06-18 22:35:10 UTC
I applied this latest patch to git master and attempted to build.  I got this:

popup-commands.c: In function 'popup_cmd_set_image_as_background':
popup-commands.c:335:38: error: 'EPHY_DOWNLOAD_ACTION_DO_NOTHING' undeclared (first use in this function)
Comment 10 Diego Escalante Urrelo (not reading bugmail) 2012-06-19 02:37:45 UTC
(In reply to comment #9)
> I applied this latest patch to git master and attempted to build.  I got this:
> 
> popup-commands.c: In function 'popup_cmd_set_image_as_background':
> popup-commands.c:335:38: error: 'EPHY_DOWNLOAD_ACTION_DO_NOTHING' undeclared
> (first use in this function)

You need the last two patches, the first one adds the missing declaration.
Comment 11 Xan Lopez 2012-06-19 08:06:09 UTC
Review of attachment 215377 [details] [review]:

Yeah, this makes more sense.
Comment 12 Xan Lopez 2012-06-19 08:06:16 UTC
Review of attachment 215378 [details] [review]:

OK.
Comment 13 Diego Escalante Urrelo (not reading bugmail) 2012-06-23 00:13:32 UTC
Done! Thanks for the report and testing the patches. It's nice of you
:-).

Attachment 215377 [details] pushed as 43a4f89 - ephy-download: add EPHY_DOWNLOAD_ACTION_DO_NOTHING
Attachment 215378 [details] pushed as 64bc15d - popup-commands: use EPHY_DOWNLOAD_ACTION_DO_NOTHING