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 140768 - add option use image as wallpaper
add option use image as wallpaper
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: EOG Maintainers
EOG Maintainers
: 145115 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-04-21 19:41 UTC by Kristof Vansant
Modified: 2005-11-06 16:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
The patch adds 'Set Image As wallpaper' menu item under the View Menu and has options to set the wallpaper in Tiled,Stretched,Scaled and Centered modes (5.25 KB, patch)
2005-02-06 09:20 UTC, Nirmal kumar
none Details | Review
This is a slightly modified patch where i have integrated kristOfVansants view ..The patch is tested n it works well (6.24 KB, patch)
2005-02-08 14:13 UTC, Nirmal kumar
none Details | Review
This fixes the bug. Thanks to chpe :) (6.34 KB, patch)
2005-07-25 14:26 UTC, Nirmal kumar
none Details | Review

Description Kristof Vansant 2004-04-21 19:41:14 UTC
plz add the option use image as wallpaper
Comment 1 Julien Olivier 2004-05-01 11:53:30 UTC
I would like that too, with the ability to choose between tiled or streched.
Comment 2 Jens Finke 2004-06-29 06:40:17 UTC
*** Bug 145115 has been marked as a duplicate of this bug. ***
Comment 3 Nirmal kumar 2005-02-06 09:20:08 UTC
Created attachment 37055 [details] [review]
The patch adds  'Set Image As wallpaper' menu item under the View Menu and has options to set the wallpaper in Tiled,Stretched,Scaled and Centered modes
Comment 4 Kristof Vansant 2005-02-06 15:03:18 UTC
there is one problem you could have:

if the file you are watching and set as wallpaper is on a floppy, cdrom or
network share the image can become unavailable after a time. wouldn't it be
better to let it copy the image to eogwallpaper.jpg in the ~/ directory and set
this as wallpaper? I know it will cost us some extra space. But with hd space so
cheap this days.

Or do you have a better protection against the problem?
PS: plz don't say: the user should know that it shouldn't use a image from a
cdrom as background. (users don't have to think :P)
Comment 5 Kristof Vansant 2005-02-06 16:05:03 UTC
I think the best thing is to make it a hidden file.
because if the user sees this file in his home directory he will think that the
file is going to stay forever. But the next time he uses eog to change the
background the picture will be lost. and he can be unhappy because he thought it
was going to stay. This will force the user to copy pictures that he want local
for him self and not using eog setbackground.

so .eogbackground.jpg

can't the background selector be patched to search the home directory and then
show all the hiddenfiles wit .*background.* ?

so you get a selection for files but also for apps
Comment 6 Kristof Vansant 2005-02-08 01:19:56 UTC
something like:

+static void set_as_wallpaper (EogWindow *window, EogImage *image,WallpaperAlign
align)
+{
+	EogWindowPrivate *priv;
+	GnomeVFSURI *img_uri, *img_dst_uri;
+	GConfClient *client;
+	char *options = NULL;
+	
+	gchar *wallpaperfile, *filename;
+
+	GnomeVFSResult result;
+	
+	g_return_if_fail (EOG_IS_WINDOW (window));
+	g_return_if_fail (EOG_IS_IMAGE (image));
+
+	priv = window->priv;
+
+	img_uri = eog_image_get_uri (image);
+	filename = gnome_vfs_uri_to_string(img_uri,GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD);
+	
+	wallpaperfile = g_strdup_printf ("%s/.%s-wallpaper" ,g_get_home_dir
(),g_get_prgname());		
+	img_dst_uri = gnome_vfs_uri_new (wallpaperfile);
+
+	result = gnome_vfs_xfer_uri (img_uri, img_dst_uri, GNOME_VFS_XFER_DEFAULT,
GNOME_VFS_XFER_ERROR_MODE_ABORT ,GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE, NULL, NULL);
+	if (result != NULL){
+		g_printerr("%s\n", gnome_vfs_result_to_string (result));
+        return;
+	}
+	
+	client = gconf_client_get_default();
Comment 7 Nirmal kumar 2005-02-08 14:13:28 UTC
Created attachment 37166 [details] [review]
This is a slightly modified patch where i have integrated kristOfVansants view ..The patch is tested n it works well

Cant we just copy the file to /usr/share/backgrounds/images where generally the
default images of Gnome are kept??.. So that the user can use them whenever
neccessary..
Comment 8 Kristof Vansant 2005-02-08 16:00:19 UTC
euhm I don't think you have writing rights to that map. Or you must be running
eog as root. so storing in the home directory is the safest way.
Comment 9 Kristof Vansant 2005-02-08 16:01:47 UTC
I openend this feature request:
http://bugzilla.gnome.org/show_bug.cgi?id=166615
Comment 10 Christian Persch 2005-05-10 15:57:44 UTC
Instead of having the tiled/streched/centred/etc options duplicated in eog, why
not just open the GNOME backgrounds capplet when setting the background? That's
what Epiphany does in this case, on advice from clarkbw (iirc).
Comment 11 Philip Van Hoof 2005-07-15 12:05:01 UTC
If somebody implements what Christian Persch suggested, we'd be happy to commit
such a patch (provided bugfree).
Comment 12 Nirmal kumar 2005-07-25 14:26:41 UTC
Created attachment 49717 [details] [review]
This fixes the bug. Thanks to chpe :)
Comment 13 Christian Persch 2005-07-26 10:33:35 UTC
Thanks for the patch!

I should note that the functions to launch the background capplet .desktop file
are copied verbatim from epiphany, so should be ok (although you could simplify
them since |parameter| will always be NULL here). Since I don't know eog
interna, I'll let others comment on the verb_SetAsWallpaper_cb implementation.
Comment 14 Lucas Rocha 2005-11-06 16:50:18 UTC
Applied in HEAD with the following changes: 
1. Coding style fixes;
2. Unused parameter removed;
3. Better use of eog API;
3. Menu item added to "Image" menu, not to the "View" one;
4. Menu item is sensitive only when a single image is selected.

Thanks!