Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h backgrounds.c desktops.c settings.c 


Log Message:
Fix various background pixmap related bugs.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -3 -r1.272 -r1.273
--- E.h 29 May 2004 19:01:55 -0000      1.272
+++ E.h 30 May 2004 13:09:15 -0000      1.273
@@ -1686,6 +1686,7 @@
 void                BackgroundTouch(Background * bg);
 const char         *BackgroundGetName(const Background * bg);
 Pixmap              BackgroundGetPixmap(const Background * bg);
+int                 BackgroundGetColor(const Background * bg);
 void                BackgroundsAccounting(void);
 void                BackgroundsInit(void);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/backgrounds.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- backgrounds.c       4 May 2004 19:04:22 -0000       1.3
+++ backgrounds.c       30 May 2004 13:09:15 -0000      1.4
@@ -354,6 +354,12 @@
    *ph = h;
 }
 
+/*
+ * Apply a background to window/pixmap.
+ *
+ * If setbg is != 0, the (scaled) BG pixmap is stored in bg->pmap, otherwise
+ * bg->pmap is left unchanged.
+ */
 void
 BackgroundApply(Background * bg, Window win, int setbg)
 {
@@ -386,14 +392,7 @@
 #endif
      }
 
-   dpmap = bg->pmap;
-   if (!setbg && dpmap)
-     {
-       /* Always regenerate if setting non-desktop window (?) */
-       imlib_free_pixmap_and_mask(dpmap);
-       dpmap = 0;
-     }
-
+   dpmap = (setbg) ? bg->pmap : None;
    if (!dpmap)
      {
        unsigned int        w, h, x, y;
@@ -531,16 +530,13 @@
 
    if (setbg)
      {
+       if (bg->pmap != dpmap)
+          BackgroundPixmapFree(bg);
+       bg->pmap = dpmap;
        if (dpmap)
-         {
-            HintsSetRootInfo(win, dpmap, 0);
-            XSetWindowBackgroundPixmap(disp, win, dpmap);
-         }
+          XSetWindowBackgroundPixmap(disp, win, dpmap);
        else
-         {
-            HintsSetRootInfo(win, 0, bg->bg_solid.pixel);
-            XSetWindowBackground(disp, win, bg->bg_solid.pixel);
-         }
+          XSetWindowBackground(disp, win, bg->bg_solid.pixel);
        XClearWindow(disp, win);
      }
    else
@@ -555,7 +551,6 @@
             XSetFillStyle(disp, gc, FillTiled);
             XFillRectangle(disp, win, gc, 0, 0, rw, rh);
             imlib_free_pixmap_and_mask(dpmap);
-            dpmap = 0;
          }
        else
          {
@@ -568,7 +563,6 @@
          }
        XSync(disp, False);
      }
-   bg->pmap = dpmap;
 
    if (gc)
       XFreeGC(disp, gc);
@@ -618,6 +612,14 @@
    return (bg) ? bg->pmap : None;
 }
 
+int
+BackgroundGetColor(const Background * bg)
+{
+   if (bg == NULL)
+      return 0;
+   return (bg->pmap) ? 0 : bg->bg_solid.pixel;
+}
+
 void
 BackgroundsAccounting(void)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -3 -r1.89 -r1.90
--- desktops.c  4 May 2004 19:04:26 -0000       1.89
+++ desktops.c  30 May 2004 13:09:15 -0000      1.90
@@ -246,6 +246,9 @@
       EDBUG_RETURN_;
 
    BackgroundApply(bg, desks.desk[desk].win, 1);
+   HintsSetRootInfo(desks.desk[desk].win,
+                   BackgroundGetPixmap(bg), BackgroundGetColor(bg));
+
    EDBUG_RETURN_;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -3 -r1.107 -r1.108
--- settings.c  4 May 2004 19:04:35 -0000       1.107
+++ settings.c  30 May 2004 13:09:16 -0000      1.108
@@ -2472,7 +2472,7 @@
        for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
          {
             if (desks.desk[i].bg == tmp_bg)
-               DesktopSetBg(i, tmp_bg, 0);
+               DesktopSetBg(i, tmp_bg, 1);
          }
 
        {




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to