GNOME Bugzilla – Bug 676128
Use Image as Background opens image in Eye of GNOME
Last modified: 2012-06-23 00:13:40 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).
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.
Created attachment 214882 [details] [review] popup-commands: make bg img download action none
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.
(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.
(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.
(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')
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.
Created attachment 215378 [details] [review] popup-commands: use EPHY_DOWNLOAD_ACTION_DO_NOTHING Stop downloaded backgrounds from popping an image viewer instance.
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)
(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.
Review of attachment 215377 [details] [review]: Yeah, this makes more sense.
Review of attachment 215378 [details] [review]: OK.
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