~ubuntu-branches/ubuntu/natty/idesk/natty

« back to all changes in this revision

Viewing changes to src/XImlib2Background.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Avelar (Fixxxer)
  • Date: 2005-11-13 03:27:39 UTC
  • Revision ID: james.westby@ubuntu.com-20051113032739-r1q405bgsfcrmfzx
Tags: 0.7.4-2
 
* Fixed the problem with the desktop background, closes: #338281
* Fixed other minor bugs.
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
1
2
/* vim:tabstop=4:expandtab:shiftwidth=4
2
3
 * 
3
4
 * Idesk -- XImlib2Background.cpp
43
44
        
44
45
     int d = dConfig->getDelayBackground();
45
46
     directory = dConfig->getSourceBackground();
 
47
 
46
48
        
47
49
     if(d == 0 || directory == "None"){
48
50
             OneShot = true;
51
53
     srand( (unsigned)time(0) );
52
54
     
53
55
     if(OneShot){
54
 
        SetOneImage();
55
 
      }else{
56
 
        ScanImages();
57
 
        SetDelay( d );
58
 
      }
 
56
                SetOneImage();
 
57
     }else{
 
58
                ScanImages();
 
59
                SetDelay( d );
 
60
     }
59
61
        
60
62
}
61
63
 
102
104
                image = imlib_load_image(file.c_str());
103
105
        }
104
106
        
105
 
        SetMultiImage(image);
 
107
           if(image)
 
108
            SetMultiImage(image);
106
109
}
107
110
 
108
111
 
136
139
      
137
140
      pixmap = XCreatePixmap(display, rootWindow , widthOfScreen, heightOfScreen, depth);
138
141
      
139
 
      gcv.foreground = gcv.background = BlackPixel(display, screen);
140
 
      
141
 
      bgcolor = (char*)dConfig->getColorBackground().c_str();
142
 
      
143
 
      if (bgcolor && XParseColor(display, colormap , bgcolor, &xcolor) && XAllocColor(display,  colormap, &xcolor)) {
 
142
      string color = dConfig->getColorBackground();
 
143
      
 
144
      if(color != "None"){
 
145
        gcv.foreground = gcv.background = BlackPixel(display, screen);
 
146
      
 
147
        bgcolor = (char*)dConfig->getColorBackground().c_str();
 
148
      
 
149
        if (bgcolor && XParseColor(display, colormap , bgcolor, &xcolor) && XAllocColor(display,  colormap, &xcolor)) {
144
150
              gcv.foreground = gcv.background = xcolor.pixel;
145
 
      }
 
151
          }
 
152
        }
146
153
      
147
154
      gc = XCreateGC(display, pixmap, (GCForeground | GCBackground), &gcv);
148
155