Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


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


Log Message:
Fix override redirect window unregistration when switching composite off.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.438
retrieving revision 1.439
diff -u -3 -r1.438 -r1.439
--- E.h 28 May 2005 11:43:35 -0000      1.438
+++ E.h 28 May 2005 14:06:57 -0000      1.439
@@ -1501,7 +1501,7 @@
 void                EobjWindowDestroy(EObj * eo);
 
 EObj               *EobjRegister(Window win, int type);
-void                EobjUnregister(Window win);
+void                EobjUnregister(EObj * eo);
 void                EobjMap(EObj * eo, int raise);
 void                EobjUnmap(EObj * eo);
 void                EobjMove(EObj * eo, int x, int y);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- ecompmgr.c  15 May 2005 20:01:30 -0000      1.31
+++ ecompmgr.c  28 May 2005 14:07:08 -0000      1.32
@@ -1291,11 +1291,15 @@
 {
    ECmWinInfo         *cw = eo->cmhook;
 
+#if 0
    if (!cw)
       return;
+#endif
 
    D1printf("ECompMgrWinDel %#lx\n", eo->win);
 
+   EventCallbackUnregister(eo->win, 0, ECompMgrHandleWindowEvent, eo);
+
    if (eo->type == EOBJ_TYPE_DESK)
      {
        DeskBackgroundPictureFree((Desk *) eo);
@@ -1306,9 +1310,8 @@
           XCompositeUnredirectWindow(disp, eo->win, CompositeRedirectManual);
      }
 
-   finish_destroy_win(eo, gone);
-
-   EventCallbackUnregister(eo->win, 0, ECompMgrHandleWindowEvent, eo);
+   if (cw)
+      finish_destroy_win(eo, gone);
 }
 
 static void
@@ -1885,7 +1888,7 @@
 static void
 ECompMgrStop(void)
 {
-   EObj               *const *lst;
+   EObj               *const *lst1, **lst;
    int                 i, num;
 
    if (!Mode_compmgr.active)
@@ -1904,9 +1907,20 @@
 
    ECompMgrShadowsInit(ECM_SHADOWS_OFF, 0);
 
-   lst = EobjListStackGet(&num);
-   for (i = 0; i < num; i++)
-      ECompMgrWinDel(lst[i], False, False);
+   lst1 = EobjListStackGet(&num);
+   if (num > 0)
+     {
+       lst = Emalloc(num * sizeof(EObj *));
+       memcpy(lst, lst1, num * sizeof(EObj *));
+       for (i = 0; i < num; i++)
+         {
+            if (lst[i]->type == EOBJ_TYPE_EXT)
+               EobjUnregister(lst[i]); /* Modifies the object stack! */
+            else
+               ECompMgrWinDel(lst[i], False, False);
+         }
+       Efree(lst);
+     }
 
    if (allDamage)
       XFixesDestroyRegion(disp, allDamage);
@@ -2031,10 +2045,7 @@
      case DestroyNotify:
        eo = EobjListStackFind(ev->xdestroywindow.window);
        if (eo && eo->type == EOBJ_TYPE_EXT)
-         {
-            ECompMgrWinDel(eo, True, True);
-            EobjUnregister(ev->xdestroywindow.window);
-         }
+          EobjUnregister(eo);
        break;
 
 #if 0
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/eobj.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- eobj.c      16 May 2005 15:29:58 -0000      1.30
+++ eobj.c      28 May 2005 14:07:09 -0000      1.31
@@ -262,14 +262,8 @@
 }
 
 void
-EobjUnregister(Window win)
+EobjUnregister(EObj * eo)
 {
-   EObj               *eo;
-
-   eo = EobjListStackFind(win);
-   if (!eo)
-      return;
-
    EobjDestroy(eo);
 }
 




-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to