GNOME Bugzilla – Bug 140768
add option use image as wallpaper
Last modified: 2005-11-06 16:50:18 UTC
plz add the option use image as wallpaper
I would like that too, with the ability to choose between tiled or streched.
*** Bug 145115 has been marked as a duplicate of this bug. ***
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
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)
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
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();
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..
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.
I openend this feature request: http://bugzilla.gnome.org/show_bug.cgi?id=166615
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).
If somebody implements what Christian Persch suggested, we'd be happy to commit such a patch (provided bugfree).
Created attachment 49717 [details] [review] This fixes the bug. Thanks to chpe :)
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.
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!