Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        E.h ecompmgr.c ecompmgr.h eobj.c iconify.c ipc.c 


Log Message:
Fix segv, use window pixmap.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.71
retrieving revision 1.314.2.72
diff -u -3 -r1.314.2.71 -r1.314.2.72
--- E.h 13 Dec 2004 21:29:08 -0000      1.314.2.71
+++ E.h 14 Dec 2004 22:20:38 -0000      1.314.2.72
@@ -575,6 +575,7 @@
 #define EoIsFloating(eo)        ((eo)->o.floating)
 #define EoGetDesk(eo)           EobjGetDesk(&((eo)->o))
 #define EoGetLayer(eo)          ((eo)->o.layer)
+#define EoGetPixmap(eo)         EobjGetPixmap(&((eo)->o))
 
 #define EoSetWin(eo, _x)        (eo)->o.win = (_x)
 #define EoSetType(eo, _x)       (eo)->o.type = (_x)
@@ -1585,6 +1586,7 @@
 void                EobjUnregister(Window win);
 const char         *EobjGetName(const EObj * eo);
 int                 EobjGetDesk(const EObj * eo);
+Pixmap              EobjGetPixmap(const EObj * eo);
 int                 EobjSetDesk(EObj * eo, int desk);
 void                EobjSetLayer(EObj * eo, int layer);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecompmgr.c,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -3 -r1.1.2.8 -r1.1.2.9
--- ecompmgr.c  11 Dec 2004 15:51:33 -0000      1.1.2.8
+++ ecompmgr.c  14 Dec 2004 22:20:38 -0000      1.1.2.9
@@ -76,7 +76,6 @@
 #if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2
 #define HAS_NAME_WINDOW_PIXMAP 1
 #endif
-#undef HAS_NAME_WINDOW_PIXMAP
 
 #define CAN_DO_USABLE 0
 
@@ -164,6 +163,9 @@
 static struct
 {
    char                active;
+#if HAS_NAME_WINDOW_PIXMAP
+   char                have_name_pixmap;
+#endif
 } Mode_compmgr;
 
 static Picture      rootPicture;
@@ -173,10 +175,6 @@
 
 static Bool         clipChanged;
 
-#if HAS_NAME_WINDOW_PIXMAP
-static Bool         hasNamePixmap;
-#endif
-
 #define OPAQUE         0xffffffff
 
 #define WINDOW_SOLID   0
@@ -332,7 +330,7 @@
      }
 
 #if xHAS_NAME_WINDOW_PIXMAP    /* Do this? */
-   if (hasNamePixmap)
+   if (Mode_compmgr.have_name_pixmap)
      {
        pmap = XCompositeNameWindowPixmap(dpy, id);
        desks[desk].bgpmap = pmap;
@@ -913,7 +911,7 @@
 }
 
 Pixmap
-ECompMgrWinGetPixmap(EObj * eo)
+ECompMgrWinGetPixmap(const EObj * eo)
 {
 #if HAS_NAME_WINDOW_PIXMAP
    ECmWinInfo         *w = eo->cmhook;
@@ -1474,7 +1472,9 @@
        eo = lst[i];
        if (!eo->cmhook)
          {
-            Eprintf("??? %#lx %s\n", eo->win, EobjGetName(eo));
+            /* Atm we first hook up when mapped */
+            /* Maybe do it at init/create? */
+            continue;
          }
        w = eo->cmhook;
 
@@ -1492,11 +1492,13 @@
             Drawable            draw = eo->win;
 
 #if HAS_NAME_WINDOW_PIXMAP
-            if (hasNamePixmap && !w->pixmap)
+            if (Mode_compmgr.have_name_pixmap && !w->pixmap)
                w->pixmap = XCompositeNameWindowPixmap(dpy, eo->win);
+#if 0                          /* ??? */
             if (w->pixmap)
                draw = w->pixmap;
 #endif
+#endif
             pictfmt = XRenderFindVisualFormat(dpy, w->a.visual);
             pa.subwindow_mode = IncludeInferiors;
             w->picture = XRenderCreatePicture(dpy, draw,
@@ -1933,7 +1935,7 @@
 static void
 ECompMgrInit(void)
 {
-   int                 events, errors;
+   int                 events, errors, major, minor;
 
    if (!XDamageQueryExtension(disp, &events, &errors))
      {
@@ -1941,6 +1943,15 @@
        goto done;
      }
 
+   if (!XDamageQueryExtension(disp, &major, &minor))
+     {
+       Conf_compmgr.mode = ECOMPMGR_MODE_OFF;
+       goto done;
+     }
+#if HAS_NAME_WINDOW_PIXMAP
+   Mode_compmgr.have_name_pixmap = (major > 0 || minor >= 2);
+#endif
+
    if (Conf_compmgr.args)
      {
        switch (Conf_compmgr.args[0])
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecompmgr.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -3 -r1.1.2.3 -r1.1.2.4
--- ecompmgr.h  11 Dec 2004 15:51:34 -0000      1.1.2.3
+++ ecompmgr.h  14 Dec 2004 22:20:39 -0000      1.1.2.4
@@ -5,10 +5,9 @@
 
 #if USE_COMPOSITE
 void                ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity);
-Pixmap              ECompMgrWinGetPixmap(EObj * eo);
+Pixmap              ECompMgrWinGetPixmap(const EObj * eo);
 #else
-#define ECompMgrWinChangeOpacity(eo, opacity)
-#define ECompMgrWinGetPixmap(eo) None
+#define             ECompMgrWinChangeOpacity(eo, opacity)
 #endif
 
 #endif /* _ECOMPMGR_H */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/eobj.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -3 -r1.1.2.4 -r1.1.2.5
--- eobj.c      9 Dec 2004 22:07:34 -0000       1.1.2.4
+++ eobj.c      14 Dec 2004 22:20:39 -0000      1.1.2.5
@@ -21,6 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "E.h"
+#include "ecompmgr.h"
 
 const char         *
 EobjGetName(const EObj * eo)
@@ -44,6 +45,17 @@
    return (eo->sticky) ? DesksGetCurrent() : eo->desk;
 }
 
+Pixmap
+EobjGetPixmap(const EObj * eo)
+{
+   Pixmap              pmap = None;
+
+#if USE_COMPOSITE
+   pmap = ECompMgrWinGetPixmap(eo);
+#endif
+   return pmap;
+}
+
 int
 EobjSetDesk(EObj * eo, int desk)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.116.2.26
retrieving revision 1.116.2.27
diff -u -3 -r1.116.2.26 -r1.116.2.27
--- iconify.c   11 Dec 2004 15:51:35 -0000      1.116.2.26
+++ iconify.c   14 Dec 2004 22:20:39 -0000      1.116.2.27
@@ -717,6 +717,7 @@
    int                 w, h, scale;
    Iconbox            *ib;
    Imlib_Image        *im;
+   Drawable            draw;
 
    if (!EwinIsMapped(ewin))
       return;
@@ -743,12 +744,32 @@
       w = 4;
    if (h < 4)
       h = 4;
+   if (w > EoGetW(ewin) || h > EoGetH(ewin))
+     {
+       w = EoGetW(ewin);
+       h = EoGetH(ewin);
+     }
 
-   imlib_context_set_drawable(EoGetWin(ewin));
-   im = imlib_create_scaled_image_from_drawable(None, 0, 0, EoGetW(ewin),
-                                               EoGetH(ewin), w, h, 1, 1);
-   imlib_context_set_image(im);
-   imlib_image_set_has_alpha(1);       /* Should be set by imlib? */
+#if 0
+   /* FIXME - Need to fix mask */
+   draw = EoGetPixmap(ewin);
+   if (draw != None)
+     {
+       imlib_context_set_drawable(draw);
+       im = imlib_create_scaled_image_from_drawable(None, 0, 0, EoGetW(ewin),
+                                                    EoGetH(ewin), w, h, 1, 0);
+       imlib_context_set_image(im);
+     }
+   else
+#endif
+     {
+       draw = EoGetWin(ewin);
+       imlib_context_set_drawable(draw);
+       im = imlib_create_scaled_image_from_drawable(None, 0, 0, EoGetW(ewin),
+                                                    EoGetH(ewin), w, h, 1, 1);
+       imlib_context_set_image(im);
+       imlib_image_set_has_alpha(1);   /* Should be set by imlib? */
+     }
    ewin->icon_image = im;
    ewin->icon_type = EWIN_ICON_TYPE_SNAP;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.174.2.38
retrieving revision 1.174.2.39
diff -u -3 -r1.174.2.38 -r1.174.2.39
--- ipc.c       9 Dec 2004 21:40:58 -0000       1.174.2.38
+++ ipc.c       14 Dec 2004 22:20:39 -0000      1.174.2.39
@@ -1375,8 +1375,11 @@
             "WM_COMMAND              %s\n"
             "WM_CLIENT_MACHINE       %s\n"
             "Client window           %#10lx   x,y %4i,%4i   wxh %4ix%4i\n"
-            "Frame window            %#10lx   x,y %4i,%4i   wxh %4ix%4i\n"
             "Container window        %#10lx\n"
+            "Frame window            %#10lx   x,y %4i,%4i   wxh %4ix%4i\n"
+#if USE_COMPOSITE
+            "Named pixmap            %#10lx\n"
+#endif
             "Border                  %s   lrtb %i,%i,%i,%i\n"
             "Icon window, pixmap, mask %#10lx, %#10lx, %#10lx\n"
             "Is group leader  %i  Window group leader %#lx   Client leader 
%#10lx\n"
@@ -1400,10 +1403,15 @@
             SS(ewin->icccm.wm_machine),
             ewin->client.win,
             ewin->client.x, ewin->client.y, ewin->client.w, ewin->client.h,
-            EoGetWin(ewin), EoGetX(ewin), EoGetY(ewin), EoGetW(ewin),
-            EoGetH(ewin), ewin->win_container, border->name,
-            border->border.left, border->border.right, border->border.top,
-            border->border.bottom, ewin->client.icon_win,
+            ewin->win_container,
+            EoGetWin(ewin),
+            EoGetX(ewin), EoGetY(ewin), EoGetW(ewin), EoGetH(ewin),
+#if USE_COMPOSITE
+            EoGetPixmap(ewin),
+#endif
+            border->name, border->border.left, border->border.right,
+            border->border.top, border->border.bottom,
+            ewin->client.icon_win,
             ewin->client.icon_pmap, ewin->client.icon_mask,
             ewin->client.is_group_leader, ewin->client.group,
             ewin->client.client_leader, ewin->has_transients,




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to