Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: ewin-ops.c ewins.c ewins.h gnome.c iconify.c ipc.c size.c Log Message: Fix various issues with iconification of transients and state updates. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -3 -r1.68 -r1.69 --- ewin-ops.c 9 Oct 2005 18:01:30 -0000 1.68 +++ ewin-ops.c 27 Oct 2005 22:26:37 -0000 1.69 @@ -586,7 +586,7 @@ if (!EwinIsTransient(ewin)) ModulesSignal(ESIGNAL_EWIN_ICONIFY, ewin); - ewin->state.iconified = 3; + ewin->state.iconified = 1; HideEwin(ewin); /* Save position at which the window was iconified */ @@ -595,13 +595,6 @@ if (was_shaded != ewin->state.shaded) EwinInstantShade(ewin, 0); - if (EwinIsTransient(ewin)) - { - /* We should only get here during restart */ - ewin->state.iconified = 4; - goto done; - } - ICCCM_Iconify(ewin); lst = EwinListTransients(ewin, &num, 0); @@ -611,20 +604,17 @@ if (e->state.iconified) continue; - e->state.iconified = 4; - HideEwin(e); - EwinRememberPositionSet(e); + EwinIconify(e); } - if (lst) - Efree(lst); #if ENABLE_GNOME - if (lst) + if (lst && call_depth == 1) GNOME_SetClientList(); #endif + if (lst) + Efree(lst); HintsSetWindowState(ewin); - done: call_depth--; } @@ -652,13 +642,13 @@ *py = y; } -void -EwinDeIconify(EWin * ewin) +static void +EwinDeIconify1(EWin * ewin, int dx, int dy) { static int call_depth = 0; EWin **lst, *e; int i, num; - int x, y, ox, oy, dx, dy; + int x, y; if (call_depth > 256) return; @@ -667,23 +657,12 @@ if (ewin->state.state != EWIN_STATE_ICONIC) return; - EwinRememberPositionGet(ewin, &ox, &oy); - x = ox; - y = oy; - - /* If we iconified an offscreen window, get it back on screen */ - if (!ewin->state.showingdesk) - GetOnScreenPos(x, y, EoGetW(ewin), EoGetH(ewin), &x, &y); - - dx = x - ox; - dy = y - oy; + EwinRememberPositionGet(ewin, DesksGetCurrent(), &x, &y); - if (EoIsSticky(ewin)) - EwinMove(ewin, x, y); - else - EwinMoveToDesktopAt(ewin, DesksGetCurrent(), x, y); + EwinMoveToDesktopAt(ewin, DesksGetCurrent(), x + dx, y + dy); - ModulesSignal(ESIGNAL_EWIN_DEICONIFY, ewin); + if (!EwinIsTransient(ewin)) + ModulesSignal(ESIGNAL_EWIN_DEICONIFY, ewin); ewin->state.iconified = 0; ewin->state.showingdesk = 0; @@ -696,26 +675,17 @@ for (i = 0; i < num; i++) { e = lst[i]; - if (e->state.iconified != 4) + if (!e->state.iconified) continue; - EwinRememberPositionGet(e, &ox, &oy); - if (EoIsSticky(e)) - EwinMove(e, ox + dx, oy + dy); - else - EwinMoveToDesktopAt(e, DesksGetCurrent(), ox + dx, oy + dy); - - e->state.iconified = 0; - - RaiseEwin(e); - ShowEwin(e); + EwinDeIconify1(e, dx, dy); } - if (lst) - Efree(lst); #if ENABLE_GNOME - if (lst) + if (lst && call_depth == 1) GNOME_SetClientList(); #endif + if (lst) + Efree(lst); HintsSetWindowState(ewin); @@ -723,6 +693,25 @@ } void +EwinDeIconify(EWin * ewin) +{ + int x, y, ox, oy, dx, dy; + + EwinRememberPositionGet(ewin, DesksGetCurrent(), &x, &y); + ox = x; + oy = y; + + /* If we iconified an offscreen window, get it back on screen */ + if (!ewin->state.showingdesk) + GetOnScreenPos(x, y, EoGetW(ewin), EoGetH(ewin), &x, &y); + + dx = x - ox; + dy = y - oy; + + EwinDeIconify1(ewin, dx, dy); +} + +void EwinUnStick(EWin * ewin) { @@ -825,8 +814,6 @@ #if 0 /* FIXME - Remove? */ ESync(); #endif - - HintsSetWindowState(ewin); } void @@ -885,8 +872,6 @@ #if 0 /* FIXME - Remove? */ ESync(); #endif - - HintsSetWindowState(ewin); } #define _EWIN_ADJUST_SHAPE(ewin, xo, yo) \ =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -3 -r1.118 -r1.119 --- ewins.c 27 Oct 2005 20:38:11 -0000 1.118 +++ ewins.c 27 Oct 2005 22:26:37 -0000 1.119 @@ -79,6 +79,12 @@ ewin->type = type; ewin->state.state = (Mode.wm.startup) ? EWIN_STATE_STARTUP : EWIN_STATE_NEW; + + ewin->o.stacked = -1; /* Not placed on desk yet */ + EoSetDesk(ewin, DesksGetCurrent()); + EoSetLayer(ewin, 4); + EoSetShadow(ewin, 1); + ewin->update.shape = 1; ewin->update.border = 1; ewin->lx = -1; @@ -191,12 +197,8 @@ ewin->win_container = ECreateWindow(frame, 0, 0, 1, 1, 0); } - ewin->o.stacked = -1; /* Not placed on desk yet */ - EoSetDesk(ewin, DesksGetCurrent()); EoInit(ewin, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, 1, NULL); EoSetName(ewin, Estrdup(ewin->icccm.wm_name)); - EoSetLayer(ewin, 4); - EoSetShadow(ewin, 1); EobjListFocusAdd(&ewin->o, 1); EobjListOrderAdd(&ewin->o); @@ -1498,7 +1500,7 @@ * Get saved position in relative viewport coordinates */ void -EwinRememberPositionGet(EWin * ewin, int *px, int *py) +EwinRememberPositionGet(EWin * ewin, Desk * dsk, int *px, int *py) { int x, y, ax, ay; @@ -1506,7 +1508,7 @@ y = ewin->req_y; if (!EoIsSticky(ewin)) { - DeskGetArea(EoGetDesk(ewin), &ax, &ay); + DeskGetArea(dsk, &ax, &ay); x -= ax * VRoot.w; y -= ay * VRoot.h; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewins.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ewins.h 24 Oct 2005 17:35:09 -0000 1.20 +++ ewins.h 27 Oct 2005 22:26:37 -0000 1.21 @@ -59,13 +59,13 @@ struct { char state; - char shaped; - char docked; char visibility; - char iconified; + char shaped; char shaded; unsigned placed:1; + unsigned iconified:1; + unsigned docked:1; unsigned click_grab_isset:1; unsigned maximized_horz:1; unsigned maximized_vert:1; @@ -272,7 +272,8 @@ const char *EwinGetIconName(const EWin * ewin); int EwinIsOnScreen(const EWin * ewin); void EwinRememberPositionSet(EWin * ewin); -void EwinRememberPositionGet(EWin * ewin, int *px, int *py); +void EwinRememberPositionGet(EWin * ewin, struct _desk *dsk, + int *px, int *py); void EwinChange(EWin * ewin, unsigned int flag); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/gnome.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -3 -r1.56 -r1.57 --- gnome.c 4 Sep 2005 08:10:11 -0000 1.56 +++ gnome.c 27 Oct 2005 22:26:37 -0000 1.57 @@ -666,7 +666,7 @@ wl = Emalloc(num * sizeof(unsigned int)); for (i = 0; i < num; i++) { - if (!lst[i]->props.skip_ext_task && lst[i]->state.iconified != 4) + if (!lst[i]->props.skip_ext_task && !EwinIsTransientChild(lst[i])) wl[j++] = _EwinGetClientXwin(lst[i]); } } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v retrieving revision 1.184 retrieving revision 1.185 diff -u -3 -r1.184 -r1.185 --- iconify.c 23 Oct 2005 15:02:51 -0000 1.184 +++ iconify.c 27 Oct 2005 22:26:37 -0000 1.185 @@ -2596,7 +2596,7 @@ break; case ESIGNAL_EWIN_DESTROY: ewin = (EWin *) prm; - if (ewin->state.iconified > 0) + if (ewin->state.iconified) RemoveMiniIcon(ewin); break; case ESIGNAL_EWIN_CHANGE_ICON: =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v retrieving revision 1.239 retrieving revision 1.240 diff -u -3 -r1.239 -r1.240 --- ipc.c 12 Oct 2005 17:20:42 -0000 1.239 +++ ipc.c 27 Oct 2005 22:26:37 -0000 1.240 @@ -446,9 +446,9 @@ break; case EWIN_OP_ICONIFY: - if (SetEwinBoolean - ("window iconified", &ewin->state.iconified, param1, 0)) - EwinOpIconify(ewin, !ewin->state.iconified); + on = ewin->state.iconified; + if (SetEwinBoolean("window iconified", &on, param1, 0)) + EwinOpIconify(ewin, !on); break; case EWIN_OP_OPACITY: =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/size.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- size.c 26 Jul 2005 17:01:18 -0000 1.44 +++ size.c 27 Oct 2005 22:26:37 -0000 1.45 @@ -51,7 +51,7 @@ ewin->lh = ewin->client.h; ewin->state.maximized_horz = 0; ewin->state.maximized_vert = 0; - return; + goto done; } type = MAX_ABSOLUTE; /* Select default */ @@ -169,6 +169,8 @@ ewin->lw = ewin->client.w; ewin->lh = ewin->client.h; EwinMoveResize(ewin, x, y, w, h); + done: + HintsSetWindowState(ewin); } void ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs