ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
(Generate patch)

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.166 by sf-exg, Mon Aug 15 11:01:54 2011 UTC vs.
Revision 1.167 by sf-exg, Fri Aug 19 17:42:09 2011 UTC

848rxvt_term::bg_set_file (const char *file) 848rxvt_term::bg_set_file (const char *file)
849{ 849{
850 if (!file || !*file) 850 if (!file || !*file)
851 return false; 851 return false;
852 852
853 bool ret = false;
853 if (const char *p = strchr (file, ';')) 854 const char *p = strchr (file, ';');
855
856 if (p)
854 { 857 {
855 size_t len = p - file; 858 size_t len = p - file;
856 char *f = rxvt_temp_buf<char> (len + 1); 859 char *f = rxvt_temp_buf<char> (len + 1);
857 memcpy (f, file, len); 860 memcpy (f, file, len);
858 f[len] = '\0'; 861 f[len] = '\0';
867 { 870 {
868 if (original_asim) 871 if (original_asim)
869 safe_asimage_destroy (original_asim); 872 safe_asimage_destroy (original_asim);
870 original_asim = image; 873 original_asim = image;
871 bg_flags |= BG_IS_FROM_FILE | BG_CLIENT_RENDER; 874 bg_flags |= BG_IS_FROM_FILE | BG_CLIENT_RENDER;
872 return true; 875 ret = true;
873 } 876 }
874# endif 877# endif
875 878
876# ifdef HAVE_PIXBUF 879# ifdef HAVE_PIXBUF
877 GdkPixbuf *image = gdk_pixbuf_new_from_file (file, NULL); 880 GdkPixbuf *image = gdk_pixbuf_new_from_file (file, NULL);
879 { 882 {
880 if (pixbuf) 883 if (pixbuf)
881 g_object_unref (pixbuf); 884 g_object_unref (pixbuf);
882 pixbuf = image; 885 pixbuf = image;
883 bg_flags |= BG_IS_FROM_FILE; 886 bg_flags |= BG_IS_FROM_FILE;
884 return true; 887 ret = true;
885 } 888 }
886# endif 889# endif
887 890
891 if (ret)
892 {
893 if (p)
894 bg_set_geometry (p + 1);
895 else
896 bg_set_default_geometry ();
897 }
898
888 return false; 899 return ret;
889} 900}
890 901
891# endif /* BG_IMAGE_FROM_FILE */ 902# endif /* BG_IMAGE_FROM_FILE */
892 903
893# ifdef ENABLE_TRANSPARENCY 904# ifdef ENABLE_TRANSPARENCY

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines