Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        ewin-ops.c ewins.c focus.c icccm.c menus.c 


Log Message:
Internal client handling fixes.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ewin-ops.c  10 May 2005 21:29:08 -0000      1.33
+++ ewin-ops.c  12 May 2005 22:38:00 -0000      1.34
@@ -562,6 +562,7 @@
    if (!ewin->client.transient)
       ModulesSignal(ESIGNAL_EWIN_ICONIFY, ewin);
 
+   ewin->iconified = 3;
    HideEwin(ewin);
 
    /* Save position at which the window was iconified */
@@ -577,7 +578,6 @@
        goto done;
      }
 
-   ewin->iconified = 3;
    ICCCM_Iconify(ewin);
 
    lst = EwinListTransients(ewin, &num, 0);
@@ -587,8 +587,8 @@
        if (e->iconified)
           continue;
 
-       HideEwin(e);
        e->iconified = 4;
+       HideEwin(e);
        EwinRememberPositionSet(e);
      }
    if (lst)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- ewins.c     12 May 2005 18:08:25 -0000      1.61
+++ ewins.c     12 May 2005 22:38:00 -0000      1.62
@@ -926,11 +926,47 @@
 }
 
 static void
+EwinUnmap1(EWin * ewin)
+{
+   /* The client may have been unmapped but the frame is not yet */
+
+   if (GetZoomEWin() == ewin)
+      Zoom(NULL);
+
+   ActionsEnd(ewin);
+
+   if (Mode.doingslide)
+     {
+       DrawEwinShape(ewin, Conf.slidemode, ewin->shape_x, ewin->shape_y,
+                     ewin->client.w, ewin->client.h, 2);
+       Mode.doingslide = 0;
+     }
+
+   if (ewin == GetContextEwin())
+      SlideoutsHide();
+}
+
+static void
+EwinUnmap2(EWin * ewin)
+{
+   /* The frame has been unmapped */
+
+   if (ewin == Mode.focuswin)
+      FocusToEWin(ewin, FOCUS_EWIN_GONE);
+   if (ewin == Mode.mouse_over_ewin)
+      Mode.mouse_over_ewin = NULL;
+   if (ewin == Mode.context_ewin)
+      Mode.context_ewin = NULL;
+}
+
+static void
 EwinWithdraw(EWin * ewin)
 {
    Window              win;
    int                 x, y;
 
+   /* Only external clients should go here */
+
    if (EventDebug(EDBUG_TYPE_EWINS))
       Eprintf("EwinWithdraw %#lx %s state=%d\n", ewin->client.win,
              EwinGetName(ewin), ewin->state);
@@ -949,9 +985,6 @@
 
    ESync();
    EUngrabServer();
-
-   if (EwinIsInternal(ewin))
-      EwinDestroy(ewin);
 }
 
 static void
@@ -1017,9 +1050,6 @@
 static void
 EwinEventUnmap(EWin * ewin)
 {
-   if (GetZoomEWin() == ewin)
-      Zoom(NULL);
-
    if (EventDebug(EDBUG_TYPE_EWINS))
       Eprintf("EwinEventUnmap %#lx %s state=%d\n", ewin->client.win,
              EwinGetName(ewin), ewin->state);
@@ -1031,38 +1061,27 @@
       ewin->state = EWIN_STATE_ICONIC;
    else
       ewin->state = EWIN_STATE_WITHDRAWN;
-   ewin->o.shown = 0;          /* FIXME - TBD */
 
-   ActionsEnd(ewin);
-
-   if (ewin == GetContextEwin())
-      SlideoutsHide();
-
-   if (ewin == Mode.focuswin)
-      FocusToEWin(ewin, FOCUS_EWIN_GONE);
-   if (ewin == Mode.mouse_over_ewin)
-      Mode.mouse_over_ewin = NULL;
-   if (ewin == Mode.context_ewin)
-      Mode.context_ewin = NULL;
-
-   if (Mode.doingslide)
-     {
-       DrawEwinShape(ewin, Conf.slidemode, ewin->shape_x, ewin->shape_y,
-                     ewin->client.w, ewin->client.h, 2);
-       Mode.doingslide = 0;
-     }
+   EwinUnmap1(ewin);
 
-   /* FIXME - This is to sync the client.win EXID mapped state */
    EUnmapWindow(ewin->client.win);
    EoUnmap(ewin);
 
+   EwinUnmap2(ewin);
+
    ModulesSignal(ESIGNAL_EWIN_UNMAP, ewin);
 
    if (ewin->iconified)
       return;
 
-   if (ewin->Close)
-      ewin->Close(ewin);
+   if (EwinIsInternal(ewin))
+     {
+#if 1                          /* FIXME - Remove? */
+       /* We should never get here */
+       Eprintf("FIXME: This cannot happen (%s)\n", EoGetName(ewin));
+#endif
+       return;
+     }
 
    if (WinGetParent(ewin->client.win) == ewin->win_container)
       EwinWithdraw(ewin);
@@ -1420,15 +1439,23 @@
 void
 HideEwin(EWin * ewin)
 {
-   if (!EoIsShown(ewin) || !EwinIsMapped(ewin))
+   if (!EwinIsInternal(ewin) && (!EoIsShown(ewin) || !EwinIsMapped(ewin)))
       return;
 
-   if (GetZoomEWin() == ewin)
-      Zoom(NULL);
+   EwinUnmap1(ewin);
 
    EUnmapWindow(ewin->client.win);
-
    EoUnmap(ewin);
+
+   EwinUnmap2(ewin);
+
+   if (!EwinIsInternal(ewin) || ewin->iconified)
+      return;
+
+   if (ewin->Close)
+      ewin->Close(ewin);
+
+   EwinDestroy(ewin);
 }
 
 Window
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -3 -r1.95 -r1.96
--- focus.c     7 May 2005 11:19:58 -0000       1.95
+++ focus.c     12 May 2005 22:38:01 -0000      1.96
@@ -42,7 +42,7 @@
    if (!ewin->client.need_input)
       return 0;
 
-   if (!EwinIsMapped(ewin))
+   if (!EwinIsMapped(ewin) || !EoIsShown(ewin))
       return 0;
 
    return !on_screen || EwinIsOnScreen(ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -3 -r1.94 -r1.95
--- icccm.c     7 May 2005 11:19:58 -0000       1.94
+++ icccm.c     12 May 2005 22:38:01 -0000      1.95
@@ -104,7 +104,7 @@
 {
    if (EwinIsInternal(ewin))
      {
-       EUnmapWindow(ewin->client.win);
+       HideEwin((EWin *) ewin);
        return;
      }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -3 -r1.190 -r1.191
--- menus.c     8 May 2005 12:21:47 -0000       1.190
+++ menus.c     12 May 2005 22:38:01 -0000      1.191
@@ -165,8 +165,9 @@
    ewin = m->ewin;
    if (ewin)
      {
-       HideEwin(ewin);
+       EUnmapWindow(m->win);
        EReparentWindow(m->win, VRoot.win, ewin->client.x, ewin->client.y);
+       HideEwin(ewin);
      }
    m->ewin = NULL;
 




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to