Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h ecompmgr.c eobj.c icons.c 


Log Message:
Stuff for grabbing redirected windows.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.466
retrieving revision 1.467
diff -u -3 -r1.466 -r1.467
--- E.h 10 Jul 2005 14:05:23 -0000      1.466
+++ E.h 10 Jul 2005 20:16:47 -0000      1.467
@@ -1539,9 +1539,9 @@
 int                 EobjLower(EObj * eo);
 void                EobjChangeShape(EObj * eo);
 void                EobjsRepaint(void);
+Pixmap              EobjGetPixmap(const EObj * eo);
 
 #if USE_COMPOSITE
-Pixmap              EobjGetPixmap(const EObj * eo);
 void                EobjChangeOpacity(EObj * eo, unsigned int opacity);
 #else
 #define             EobjChangeOpacity(eo, opacity)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- ecompmgr.c  9 Jul 2005 10:27:39 -0000       1.40
+++ ecompmgr.c  10 Jul 2005 20:16:47 -0000      1.41
@@ -46,10 +46,6 @@
 #include <X11/extensions/Xdamage.h>
 #include <X11/extensions/Xrender.h>
 
-#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2
-#define HAS_NAME_WINDOW_PIXMAP 1
-#endif
-
 #define CAN_DO_USABLE 0
 
 #define ENABLE_SHADOWS 1
@@ -80,9 +76,7 @@
 {
    EObj               *next;   /* Paint order */
    EObj               *prev;   /* Paint order */
-#if HAS_NAME_WINDOW_PIXMAP
    Pixmap              pixmap;
-#endif
    struct
    {
       int                 class;       /* FIXME - Remove? */
@@ -149,9 +143,7 @@
 {
    char               *args;
    char                active;
-#if HAS_NAME_WINDOW_PIXMAP
    char                use_pixmap;
-#endif
    EObj               *eo_first;
    EObj               *eo_last;
 } Mode_compmgr;
@@ -734,7 +726,6 @@
    ECmWinInfo         *cw = eo->cmhook;
    XRectangle          r;
 
-#if HAS_NAME_WINDOW_PIXMAP
    if (Mode_compmgr.use_pixmap)
      {
        cw->rcx = eo->x;
@@ -743,7 +734,6 @@
        cw->rch = eo->h + cw->a.border_width * 2;
      }
    else
-#endif
      {
        cw->rcx = eo->x + cw->a.border_width;
        cw->rcy = eo->y + cw->a.border_width;
@@ -836,14 +826,17 @@
 Pixmap
 ECompMgrWinGetPixmap(const EObj * eo)
 {
-#if HAS_NAME_WINDOW_PIXMAP
    ECmWinInfo         *cw = eo->cmhook;
 
-   return (cw) ? cw->pixmap : None;
-#else
-   eo = NULL;
-   return None;
-#endif
+   if (!cw)
+      return None;
+
+   if (cw->pixmap != None)
+      return cw->pixmap;
+
+   cw->pixmap = XCompositeNameWindowPixmap(disp, eo->win);
+
+   return cw->pixmap;
 }
 
 static void
@@ -855,18 +848,16 @@
    if (!cw)
       return;
 
-#if HAS_NAME_WINDOW_PIXMAP
    if ((what & INV_SIZE) && cw->pixmap != None)
      {
        XFreePixmap(dpy, cw->pixmap);
        cw->pixmap = None;
-       if (cw->picture != None)
+       if (cw->picture != None && Mode_compmgr.use_pixmap)
          {
             XRenderFreePicture(dpy, cw->picture);
             cw->picture = None;
          }
      }
-#endif
 
    if ((what & INV_GEOM) && cw->borderSize != None)
      {
@@ -1005,21 +996,8 @@
        return;
      }
 
-#if HAS_NAME_WINDOW_PIXMAP
-   if (cw->pixmap != None)
-     {
-       XFreePixmap(disp, cw->pixmap);
-       cw->pixmap = None;
-       if (cw->picture != None)
-         {
-            XRenderFreePicture(disp, cw->picture);
-            cw->picture = None;
-         }
-       Eprintf("*** ECompMgrWinSetPicts pixmap set!!!\n");
-     }
-   if (Mode_compmgr.use_pixmap)
+   if (cw->pixmap == None && Mode_compmgr.use_pixmap)
       cw->pixmap = XCompositeNameWindowPixmap(disp, eo->win);
-#endif
 
    if (cw->picture == None)
      {
@@ -1027,10 +1005,9 @@
        XRenderPictureAttributes pa;
        Drawable            draw = eo->win;
 
-#if HAS_NAME_WINDOW_PIXMAP
-       if (cw->pixmap)
+       if (cw->pixmap && Mode_compmgr.use_pixmap)
           draw = cw->pixmap;
-#endif
+
        pictfmt = XRenderFindVisualFormat(disp, cw->a.visual);
        pa.subwindow_mode = IncludeInferiors;
        cw->picture = XRenderCreatePicture(disp, draw,
@@ -1081,9 +1058,7 @@
      }
 
    cw->picture = None;
-#if HAS_NAME_WINDOW_PIXMAP
    cw->pixmap = None;
-#endif
 #if 0                          /* FIXME - Remove? */
    ECompMgrWinSetPicts(eo);
 #endif
@@ -2103,15 +2078,14 @@
        goto done;
      }
 
-   if (!XDamageQueryVersion(disp, &major, &minor))
+   if (!XCompositeQueryVersion(disp, &major, &minor) ||
+       (major == 0 && minor < 2))
      {
        Conf_compmgr.mode = ECM_MODE_OFF;
        goto done;
      }
-#if HAS_NAME_WINDOW_PIXMAP
-   Mode_compmgr.use_pixmap =
-      (major > 0 || minor >= 2) && Conf_compmgr.use_name_pixmap;
-#endif
+
+   Mode_compmgr.use_pixmap = Conf_compmgr.use_name_pixmap;
 
    if (Conf_compmgr.mode == ECM_MODE_OFF)
       Conf_compmgr.mode = ECM_MODE_ROOT;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/eobj.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- eobj.c      8 Jul 2005 16:48:06 -0000       1.38
+++ eobj.c      10 Jul 2005 20:16:47 -0000      1.39
@@ -422,16 +422,20 @@
 #endif
 }
 
-#if USE_COMPOSITE
 Pixmap
 EobjGetPixmap(const EObj * eo)
 {
    Pixmap              pmap = None;
 
+#if USE_COMPOSITE
    pmap = ECompMgrWinGetPixmap(eo);
+#else
+   eo = NULL;
+#endif
    return pmap;
 }
 
+#if USE_COMPOSITE
 void
 EobjChangeOpacity(EObj * eo, unsigned int opacity)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icons.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- icons.c     9 Jul 2005 12:06:18 -0000       1.5
+++ icons.c     10 Jul 2005 20:16:47 -0000      1.6
@@ -103,7 +103,6 @@
        h = hh;
      }
 
-#if USE_COMPOSITE
    draw = EoGetPixmap(ewin);
    if (draw != None)
      {
@@ -114,20 +113,17 @@
        im = imlib_create_scaled_image_from_drawable(mask, 0, 0, ww, hh,
                                                     w, h, !EServerIsGrabbed(),
                                                     0);
-       imlib_context_set_image(im);
-       imlib_image_set_has_alpha(1);   /* Should be set by imlib? */
      }
    else
-#endif
      {
        draw = EoGetWin(ewin);
        imlib_context_set_drawable(draw);
        im = imlib_create_scaled_image_from_drawable(None, 0, 0, ww, hh,
                                                     w, h, !EServerIsGrabbed(),
                                                     1);
-       imlib_context_set_image(im);
-       imlib_image_set_has_alpha(1);   /* Should be set by imlib? */
      }
+   imlib_context_set_image(im);
+   imlib_image_set_has_alpha(1);
 
    return im;
 }




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to