Stacking work. Cleanups.

SVN revision: 14309
This commit is contained in:
Kim Woelders 2005-04-23 07:31:18 +00:00
parent 98b0931f8b
commit 018408379a
15 changed files with 103 additions and 120 deletions

View File

@ -504,6 +504,7 @@ struct _eobj
short desk; /* Belongs on desk */ short desk; /* Belongs on desk */
int x, y; int x, y;
int w, h; int w, h;
signed char stacked;
char sticky; char sticky;
char floating; char floating;
char shown; char shown;
@ -512,7 +513,7 @@ struct _eobj
unsigned int opacity; unsigned int opacity;
void *cmhook; void *cmhook;
#endif #endif
char *name; /* Debug only */ char *name;
}; };
#define EOBJ_TYPE_EWIN 0 #define EOBJ_TYPE_EWIN 0
@ -558,7 +559,7 @@ struct _eobj
#define EoGetShadow(eo) 0 #define EoGetShadow(eo) 0
#endif #endif
#define EoMap(eo, raise) EobjMap(&((eo)->o), (raise)) #define EoMap(eo, raise) EobjMap(&((eo)->o), raise)
#define EoUnmap(eo) EobjUnmap(&((eo)->o)) #define EoUnmap(eo) EobjUnmap(&((eo)->o))
#define EoMove(eo, x, y) EobjMove(&((eo)->o), x, y) #define EoMove(eo, x, y) EobjMove(&((eo)->o), x, y)
#define EoResize(eo, w, h) EobjResize(&((eo)->o), w, h) #define EoResize(eo, w, h) EobjResize(&((eo)->o), w, h)
@ -1407,10 +1408,8 @@ void DeskAssignBg(int desk, Background * bg);
void DeskSetBg(int desk, Background * bg, int refresh); void DeskSetBg(int desk, Background * bg, int refresh);
int DesktopAt(int x, int y); int DesktopAt(int x, int y);
void DeskGoto(int num); void DeskGoto(int num);
void DeskMove(int num, int x, int y);
void DeskHide(int num); void DeskHide(int num);
void DeskShow(int num); void DeskShow(int num);
void StackDesktops(void);
void StackDesktop(int num); void StackDesktop(int num);
void DeskGotoByEwin(EWin * ewin); void DeskGotoByEwin(EWin * ewin);
void DesksEventsConfigure(int mode); void DesksEventsConfigure(int mode);
@ -1549,7 +1548,7 @@ void EobjChangeOpacity(EObj * eo, unsigned int opacity);
#else #else
#define EobjChangeOpacity(eo, opacity) #define EobjChangeOpacity(eo, opacity)
#endif #endif
int EobjSetDesk(EObj * eo, int desk); void EobjSetDesk(EObj * eo, int desk);
void EobjSetLayer(EObj * eo, int layer); void EobjSetLayer(EObj * eo, int layer);
void EobjSetFloating(EObj * eo, int floating); void EobjSetFloating(EObj * eo, int floating);
int EobjIsShaped(const EObj * eo); int EobjIsShaped(const EObj * eo);

View File

@ -132,9 +132,9 @@ ButtonCreate(const char *name, int id, ImageClass * iclass,
win = ECreateWindow(DeskGetWin(desk), -100, -100, 50, 50, 0); win = ECreateWindow(DeskGetWin(desk), -100, -100, 50, 50, 0);
EoSetSticky(b, sticky); EoSetSticky(b, sticky);
EoSetDesk(b, desk); EoSetDesk(b, desk);
EobjInit(&b->o, EOBJ_TYPE_BUTTON, win, -100, -100, 50, 50, name);
EoSetLayer(b, ontop); EoSetLayer(b, ontop);
EoSetShadow(b, 0); EoSetShadow(b, 0);
EobjInit(&b->o, EOBJ_TYPE_BUTTON, win, -100, -100, 50, 50, name);
ESelectInput(EoGetWin(b), BUTTON_EVENT_MASK); ESelectInput(EoGetWin(b), BUTTON_EVENT_MASK);
EventCallbackRegister(EoGetWin(b), 0, ButtonHandleEvents, b); EventCallbackRegister(EoGetWin(b), 0, ButtonHandleEvents, b);
@ -635,11 +635,13 @@ ButtonEventMotion(Button * b, XEvent * ev __UNUSED__)
if (b) if (b)
{ {
ButtonMoveRelative(b, dx, dy); ButtonMoveRelative(b, dx, dy);
#if 0 /* FIXME - Not active */
if (Conf.deskmode == MODE_DESKRAY) if (Conf.deskmode == MODE_DESKRAY)
{ {
DeskMove(Mode.deskdrag, DeskGetX(Mode.deskdrag), DeskMove(Mode.deskdrag, DeskGetX(Mode.deskdrag),
DeskGetY(Mode.deskdrag) + dy); DeskGetY(Mode.deskdrag) + dy);
} }
#endif
} }
} }
} }
@ -1109,7 +1111,6 @@ doHideShowButton(const char *params)
} }
done: done:
StackDesktops();
autosave(); autosave();
} }

View File

@ -91,7 +91,7 @@ CoordsShow(EWin * ewin)
EobjMoveResize(eo, cx, cy, cw, ch); EobjMoveResize(eo, cx, cy, cw, ch);
if (!eo->shown) if (!eo->shown)
EobjMap(eo, 1); EobjMap(eo, 0);
ImageclassApply(ic, eo->win, cw, ch, 1, 0, STATE_NORMAL, 0, ST_UNKNWN); ImageclassApply(ic, eo->win, cw, ch, 1, 0, STATE_NORMAL, 0, ST_UNKNWN);
TextclassApply(ic, eo->win, cw, ch, 0, 0, STATE_NORMAL, 0, tc, s); TextclassApply(ic, eo->win, cw, ch, 0, 0, STATE_NORMAL, 0, tc, s);

View File

@ -41,6 +41,7 @@ typedef struct _desktops
} }
Desktops; Desktops;
static void DeskMove(Desk * d, int x, int y);
static void DeskRaise(int num); static void DeskRaise(int num);
static void DeskLower(int num); static void DeskLower(int num);
static void DesktopHandleEvents(XEvent * ev, void *prm); static void DesktopHandleEvents(XEvent * ev, void *prm);
@ -300,9 +301,6 @@ DeskControlsCreate(Desk * d)
} }
#endif #endif
/* Restack buttons - Hmmm. */
StackDesktop(d->num);
d->tag = b; d->tag = b;
} }
@ -416,11 +414,10 @@ DeskCreate(int desk, int configure)
Esnprintf(buf, sizeof(buf), "Desk-%d", desk); Esnprintf(buf, sizeof(buf), "Desk-%d", desk);
EobjInit(&d->o, EOBJ_TYPE_DESK, win, 0, 0, VRoot.w, VRoot.h, buf); EobjInit(&d->o, EOBJ_TYPE_DESK, win, 0, 0, VRoot.w, VRoot.h, buf);
EoSetShadow(d, 0); EoSetShadow(d, 0);
EoSetLayer(d, 0);
if (desk > 0) if (desk > 0)
{ {
EoSetFloating(d, 1); EoSetFloating(d, 1);
EobjListStackRaise(&d->o); EoSetLayer(d, 0);
#if 0 /* TBD */ #if 0 /* TBD */
d->event_mask = EDESK_EVENT_MASK; d->event_mask = EDESK_EVENT_MASK;
DeskEventsConfigure(d, 1); DeskEventsConfigure(d, 1);
@ -572,6 +569,8 @@ DeskSetDirtyStack(int desk)
return; return;
d->dirty_stack++; d->dirty_stack++;
if (EventDebug(EDBUG_TYPE_DESKS))
Eprintf("DeskSetDirtyStack %d (%d)\n", desk, d->dirty_stack);
} }
Window Window
@ -727,7 +726,6 @@ DeskShowTabs(void)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
ButtonShow(blst[i]); ButtonShow(blst[i]);
Efree(blst); Efree(blst);
StackDesktops();
} }
} }
@ -743,7 +741,6 @@ DeskHideTabs(void)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
ButtonHide(blst[i]); ButtonHide(blst[i]);
Efree(blst); Efree(blst);
StackDesktops();
} }
} }
#endif #endif
@ -994,25 +991,25 @@ DeskGoto(int desk)
switch (Conf.desks.dragdir) switch (Conf.desks.dragdir)
{ {
case 0: case 0:
DeskMove(desk, VRoot.w, 0); DeskMove(d, VRoot.w, 0);
DeskRaise(desk); DeskRaise(desk);
EobjSlideTo(&d->o, VRoot.w, 0, 0, 0, EobjSlideTo(&d->o, VRoot.w, 0, 0, 0,
Conf.desks.slidespeed); Conf.desks.slidespeed);
break; break;
case 1: case 1:
DeskMove(desk, -VRoot.w, 0); DeskMove(d, -VRoot.w, 0);
DeskRaise(desk); DeskRaise(desk);
EobjSlideTo(&d->o, -VRoot.w, 0, 0, 0, EobjSlideTo(&d->o, -VRoot.w, 0, 0, 0,
Conf.desks.slidespeed); Conf.desks.slidespeed);
break; break;
case 2: case 2:
DeskMove(desk, 0, VRoot.h); DeskMove(d, 0, VRoot.h);
DeskRaise(desk); DeskRaise(desk);
EobjSlideTo(&d->o, 0, VRoot.h, 0, 0, EobjSlideTo(&d->o, 0, VRoot.h, 0, 0,
Conf.desks.slidespeed); Conf.desks.slidespeed);
break; break;
case 3: case 3:
DeskMove(desk, 0, -VRoot.h); DeskMove(d, 0, -VRoot.h);
DeskRaise(desk); DeskRaise(desk);
EobjSlideTo(&d->o, 0, -VRoot.h, 0, 0, EobjSlideTo(&d->o, 0, -VRoot.h, 0, 0,
Conf.desks.slidespeed); Conf.desks.slidespeed);
@ -1027,14 +1024,12 @@ DeskGoto(int desk)
Conf.desks.slidespeed); Conf.desks.slidespeed);
DeskRaise(desk); DeskRaise(desk);
} }
StackDesktops();
} }
else else
{ {
DeskRaise(desk); DeskRaise(desk);
StackDesktops();
} }
DeskMove(desk, 0, 0); DeskMove(d, 0, 0);
} }
else else
{ {
@ -1052,29 +1047,25 @@ DeskGoto(int desk)
HandleDrawQueue(); HandleDrawQueue();
} }
void static void
DeskMove(int desk, int x, int y) DeskMove(Desk * d, int x, int y)
{ {
Desk *d, *dd; Desk *dd;
int i; int i;
EWin *const *lst; EWin *const *lst;
int n, v, dx, dy; int n, v, dx, dy;
if (desk <= 0 || desk >= Conf.desks.num)
return;
n = -1; n = -1;
i = 0; i = 0;
while (n < 0 && i < Conf.desks.num) while (n < 0 && i < Conf.desks.num)
{ {
if (desks.order[i] == desk) if (desks.order[i] == d->num)
n = i; n = i;
i++; i++;
} }
if (n < 0) /* Should not be possible */ if (n < 0) /* Should not be possible */
return; return;
d = _DeskGet(desk);
dx = x - EoGetX(d); dx = x - EoGetX(d);
dy = y - EoGetY(d); dy = y - EoGetY(d);
@ -1122,10 +1113,27 @@ DeskMove(int desk, int x, int y)
lst = EwinListGetAll(&n); lst = EwinListGetAll(&n);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
if (EoGetDesk(lst[i]) == desk) if (EoGetDesk(lst[i]) == d->num)
ICCCM_Configure(lst[i]); ICCCM_Configure(lst[i]);
} }
static void
DesksStackingCheck(void)
{
Desk *d;
int i;
for (i = 0; i < Conf.desks.num; i++)
{
d = DeskGet(i);
if (i && !d->viewable)
continue;
if (!d->dirty_stack)
continue;
StackDesktop(i);
}
}
static void static void
UncoverDesktop(int desk) UncoverDesktop(int desk)
{ {
@ -1173,10 +1181,9 @@ DeskRaise(int desk)
EoMap(d, 0); EoMap(d, 0);
} }
StackDesktops();
MoveStickyWindowsToCurrentDesk(); MoveStickyWindowsToCurrentDesk();
MoveStickyButtonsToCurrentDesk(); MoveStickyButtonsToCurrentDesk();
StackDesktop(DesksGetCurrent()); DesksStackingCheck();
FocusNewDesk(); FocusNewDesk();
if (Mode.mode == MODE_NONE) if (Mode.mode == MODE_NONE)
{ {
@ -1204,10 +1211,9 @@ DeskLower(int desk)
UncoverDesktop(desks.order[0]); UncoverDesktop(desks.order[0]);
DeskHide(desk); DeskHide(desk);
StackDesktops();
MoveStickyWindowsToCurrentDesk(); MoveStickyWindowsToCurrentDesk();
MoveStickyButtonsToCurrentDesk(); MoveStickyButtonsToCurrentDesk();
StackDesktop(DesksGetCurrent()); DesksStackingCheck();
FocusNewDesk(); FocusNewDesk();
if (Mode.mode == MODE_NONE) if (Mode.mode == MODE_NONE)
{ {
@ -1256,17 +1262,10 @@ DeskShow(int desk)
} }
else else
{ {
StackDesktops();
EoMap(d, 0); EoMap(d, 0);
} }
} }
void
StackDesktops(void)
{
StackDesktop(0);
}
#define _APPEND_TO_WIN_LIST(win) \ #define _APPEND_TO_WIN_LIST(win) \
{ \ { \
wl = Erealloc(wl, ++tot * sizeof(Window)); \ wl = Erealloc(wl, ++tot * sizeof(Window)); \
@ -1275,6 +1274,7 @@ StackDesktops(void)
void void
StackDesktop(int desk) StackDesktop(int desk)
{ {
Desk *d = DeskGet(desk);
Window *wl; Window *wl;
int i, num, tot; int i, num, tot;
EObj *const *lst, *eo; EObj *const *lst, *eo;
@ -1285,24 +1285,12 @@ StackDesktop(int desk)
wl = NULL; wl = NULL;
lst = EobjListStackGetForDesk(&num, desk); lst = EobjListStackGetForDesk(&num, desk);
/* Floating objects */
for (i = 0; i < num; i++)
{
eo = lst[i];
if (!eo->floating)
continue;
_APPEND_TO_WIN_LIST(eo->win);
}
/* Normal objects */ /* Normal objects */
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
eo = lst[i]; eo = lst[i];
if (eo->floating)
continue;
_APPEND_TO_WIN_LIST(eo->win); _APPEND_TO_WIN_LIST(eo->win);
eo->stacked = 1;
} }
if (EventDebug(EDBUG_TYPE_STACKING)) if (EventDebug(EDBUG_TYPE_STACKING))
@ -1317,6 +1305,10 @@ StackDesktop(int desk)
if (wl) if (wl)
Efree(wl); Efree(wl);
if (EventDebug(EDBUG_TYPE_DESKS))
Eprintf("StackDesktop %d (%d)\n", d->num, d->dirty_stack);
d->dirty_stack = 0;
} }
void void
@ -1371,24 +1363,24 @@ DeskDragMotion(void)
case 0: case 0:
if ((EoGetX(d) + dx) < 0) if ((EoGetX(d) + dx) < 0)
dx = -EoGetX(d); dx = -EoGetX(d);
DeskMove(Mode.deskdrag, EoGetX(d) + dx, EoGetY(d)); DeskMove(d, EoGetX(d) + dx, EoGetY(d));
break; break;
case 1: case 1:
if ((EoGetX(d) + dx) > 0) if ((EoGetX(d) + dx) > 0)
DeskMove(Mode.deskdrag, 0, EoGetY(d)); DeskMove(d, 0, EoGetY(d));
else else
DeskMove(Mode.deskdrag, EoGetX(d) + dx, EoGetY(d)); DeskMove(d, EoGetX(d) + dx, EoGetY(d));
break; break;
case 2: case 2:
if ((EoGetY(d) + dy) < 0) if ((EoGetY(d) + dy) < 0)
dy = -EoGetY(d); dy = -EoGetY(d);
DeskMove(Mode.deskdrag, EoGetX(d), EoGetY(d) + dy); DeskMove(d, EoGetX(d), EoGetY(d) + dy);
break; break;
case 3: case 3:
if ((EoGetY(d) + dy) > 0) if ((EoGetY(d) + dy) > 0)
DeskMove(Mode.deskdrag, EoGetX(d), 0); DeskMove(d, EoGetX(d), 0);
else else
DeskMove(Mode.deskdrag, EoGetX(d), EoGetY(d) + dy); DeskMove(d, EoGetX(d), EoGetY(d) + dy);
break; break;
default: default:
break; break;
@ -1469,9 +1461,13 @@ DeskDragdirSet(const char *params)
if (pd != Conf.desks.dragdir) if (pd != Conf.desks.dragdir)
{ {
int i; int i;
Desk *d;
for (i = 0; i < Conf.desks.num; i++) for (i = 0; i < Conf.desks.num; i++)
DeskMove(i, 0, 0); {
d = _DeskGet(i);
EoMove(d, (d->viewable) ? 0 : VRoot.w, 0);
}
DesksControlsRefresh(); DesksControlsRefresh();
} }
} }
@ -1619,6 +1615,10 @@ DesktopsSighan(int sig, void *prm __UNUSED__)
/* Draw all the buttons that belong on the desktop */ /* Draw all the buttons that belong on the desktop */
DeskShowButtons(); DeskShowButtons();
break; break;
case ESIGNAL_IDLE:
DesksStackingCheck();
break;
} }
} }

View File

@ -206,19 +206,19 @@ EdgeWindowsShow(void)
if (cx == 0 && !Conf.desks.areas_wraparound) if (cx == 0 && !Conf.desks.areas_wraparound)
EobjUnmap(w1); EobjUnmap(w1);
else else
EobjMap(w1, 1); EobjMap(w1, 0);
if (cx == (ax - 1) && !Conf.desks.areas_wraparound) if (cx == (ax - 1) && !Conf.desks.areas_wraparound)
EobjUnmap(w2); EobjUnmap(w2);
else else
EobjMap(w2, 1); EobjMap(w2, 0);
if (cy == 0 && !Conf.desks.areas_wraparound) if (cy == 0 && !Conf.desks.areas_wraparound)
EobjUnmap(w3); EobjUnmap(w3);
else else
EobjMap(w3, 1); EobjMap(w3, 0);
if (cy == (ay - 1) && !Conf.desks.areas_wraparound) if (cy == (ay - 1) && !Conf.desks.areas_wraparound)
EobjUnmap(w4); EobjUnmap(w4);
else else
EobjMap(w4, 1); EobjMap(w4, 0);
} }
void void

View File

@ -23,14 +23,17 @@
#include "E.h" #include "E.h"
#include "ecompmgr.h" #include "ecompmgr.h"
int void
EobjSetDesk(EObj * eo, int desk) EobjSetDesk(EObj * eo, int desk)
{ {
int pdesk = eo->desk;
switch (eo->type) switch (eo->type)
{ {
default: default:
eo->desk = desk; eo->desk = desk;
break; break;
case EOBJ_TYPE_EWIN: case EOBJ_TYPE_EWIN:
if (eo->floating) if (eo->floating)
eo->desk = 0; eo->desk = 0;
@ -39,17 +42,17 @@ EobjSetDesk(EObj * eo, int desk)
else else
eo->desk = desk % Conf.desks.num; eo->desk = desk % Conf.desks.num;
break; break;
case EOBJ_TYPE_BUTTON:
eo->desk = desk;
break;
} }
return eo->desk; if (eo->desk != pdesk && eo->stacked > 0)
DeskSetDirtyStack(eo->desk);
} }
void void
EobjSetLayer(EObj * eo, int layer) EobjSetLayer(EObj * eo, int layer)
{ {
int ilayer = eo->ilayer;
eo->layer = layer; eo->layer = layer;
/* /*
* For usual EWin's the internal layer is the "old" E-layer * 10. * For usual EWin's the internal layer is the "old" E-layer * 10.
@ -101,6 +104,9 @@ EobjSetLayer(EObj * eo, int layer)
eo->ilayer |= 512; eo->ilayer |= 512;
else else
eo->ilayer &= ~512; eo->ilayer &= ~512;
if (eo->ilayer != ilayer)
EobjListStackRaise(eo);
} }
void void
@ -254,7 +260,6 @@ EobjRegister(Window win, int type)
{ {
EobjSetFloating(eo, 1); EobjSetFloating(eo, 1);
EobjSetLayer(eo, 4); EobjSetLayer(eo, 4);
EobjListStackRaise(eo);
} }
#endif #endif
@ -283,6 +288,13 @@ EobjMap(EObj * eo, int raise)
if (raise) if (raise)
EobjListStackRaise(eo); EobjListStackRaise(eo);
if (eo->stacked <= 0)
{
if (eo->stacked < 0)
DeskSetDirtyStack(eo->desk);
StackDesktop(eo->desk);
}
EMapWindow(eo->win); EMapWindow(eo->win);
#if USE_COMPOSITE #if USE_COMPOSITE
ECompMgrWinMap(eo); ECompMgrWinMap(eo);

View File

@ -216,10 +216,6 @@ HandleEvent(XEvent * ev)
else else
#endif #endif
{ {
#if 0 /* FIXME - TBD */
if (ev->type == KeyPress)
PagerHideAllHi();
#endif
lst = ListItemType(&num, LIST_TYPE_ACLASS_GLOBAL); lst = ListItemType(&num, LIST_TYPE_ACLASS_GLOBAL);
if (lst) if (lst)
{ {

View File

@ -108,6 +108,7 @@ EwinCreate(Window win, int type)
ewin->ewmh.opacity = 0; /* If 0, ignore */ ewin->ewmh.opacity = 0; /* If 0, ignore */
frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1); frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
ewin->o.stacked = -1; /* Not placed on desk yet */
EobjInit(&ewin->o, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, NULL); EobjInit(&ewin->o, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, NULL);
EoSetDesk(ewin, DesksGetCurrent()); EoSetDesk(ewin, DesksGetCurrent());
EoSetLayer(ewin, 4); EoSetLayer(ewin, 4);
@ -798,9 +799,6 @@ AddToFamily(EWin * ewin, Window win)
} }
} }
/* Force reparent if not on desk 0 */
EoSetDesk(ewin, 0);
/* if the window asked to be iconified at the start */ /* if the window asked to be iconified at the start */
if (ewin->client.start_iconified) if (ewin->client.start_iconified)
{ {
@ -833,10 +831,8 @@ AddToFamily(EWin * ewin, Window win)
ewin->client.already_placed = 1; ewin->client.already_placed = 1;
x = Mode.x + 1; x = Mode.x + 1;
y = Mode.y + 1; y = Mode.y + 1;
MoveEwinToDesktop(ewin, desk); MoveEwinToDesktopAt(ewin, desk, x, y);
RaiseEwin(ewin);
MoveEwin(ewin, x, y); MoveEwin(ewin, x, y);
RaiseEwin(ewin);
ShowEwin(ewin); ShowEwin(ewin);
GrabPointerSet(VRoot.win, ECSR_GRAB, 0); GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
Mode.have_place_grab = 1; Mode.have_place_grab = 1;
@ -848,7 +844,6 @@ AddToFamily(EWin * ewin, Window win)
} }
else if ((doslide) && (!Mode.doingslide)) else if ((doslide) && (!Mode.doingslide))
{ {
MoveEwin(ewin, VRoot.w, VRoot.h);
k = rand() % 4; k = rand() % 4;
if (k == 0) if (k == 0)
{ {
@ -870,9 +865,7 @@ AddToFamily(EWin * ewin, Window win)
fx = VRoot.w; fx = VRoot.w;
fy = (rand() % (VRoot.h)) - EoGetH(ewin); fy = (rand() % (VRoot.h)) - EoGetH(ewin);
} }
MoveEwinToDesktop(ewin, desk); MoveEwinToDesktopAt(ewin, desk, fx, fy);
RaiseEwin(ewin);
MoveEwin(ewin, fx, fy);
ShowEwin(ewin); ShowEwin(ewin);
SlideEwinTo(ewin, fx, fy, x, y, Conf.slidespeedmap); SlideEwinTo(ewin, fx, fy, x, y, Conf.slidespeedmap);
MoveEwinToDesktopAt(ewin, desk, x, y); MoveEwinToDesktopAt(ewin, desk, x, y);
@ -880,7 +873,6 @@ AddToFamily(EWin * ewin, Window win)
else else
{ {
MoveEwinToDesktopAt(ewin, desk, x, y); MoveEwinToDesktopAt(ewin, desk, x, y);
RaiseEwin(ewin);
ShowEwin(ewin); ShowEwin(ewin);
} }
@ -985,11 +977,6 @@ EwinConformToDesktop(EWin * ewin)
MoveEwin(ewin, EoGetX(ewin), EoGetY(ewin)); MoveEwin(ewin, EoGetX(ewin), EoGetY(ewin));
} }
/* FIXME - This should not be necessary. It is when a new window is added as
* the only one in the lowest layer (e.g. desktop type).
* In stead EobjListStackAdd() should mark the object stack dirty. */
StackDesktop(EoGetDesk(ewin));
EwinDetermineArea(ewin); EwinDetermineArea(ewin);
HintsSetWindowDesktop(ewin); HintsSetWindowDesktop(ewin);
} }

View File

@ -988,15 +988,10 @@ MenuDrawItem(Menu * m, MenuItem * mi, char shape)
} }
static void static void
MenuShowMasker(Menu * m) MenuShowMasker(Menu * m __UNUSED__)
{ {
EWin *ewin;
EObj *eo = Mode_menus.cover_win; EObj *eo = Mode_menus.cover_win;
ewin = FindEwinByMenu(m);
if (!ewin)
return;
if (!eo) if (!eo)
{ {
eo = EobjWindowCreate(EOBJ_TYPE_EVENT, 0, 0, VRoot.w, VRoot.h, 0, eo = EobjWindowCreate(EOBJ_TYPE_EVENT, 0, 0, VRoot.w, VRoot.h, 0,
@ -1010,13 +1005,11 @@ MenuShowMasker(Menu * m)
ESelectInput(eo->win, ButtonPressMask | ButtonReleaseMask | ESelectInput(eo->win, ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask); EnterWindowMask | LeaveWindowMask);
EventCallbackRegister(eo->win, 0, MenuMaskerHandleEvents, NULL); EventCallbackRegister(eo->win, 0, MenuMaskerHandleEvents, NULL);
#if 1 /* FIXME - Too expensive */
StackDesktop(EoGetDesk(ewin));
#endif
Mode_menus.cover_win = eo; Mode_menus.cover_win = eo;
} }
EobjMap(eo, 1); EobjMap(eo, 0);
} }
static void static void
@ -1769,10 +1762,6 @@ MenuItemEventMouseIn(MenuItem * mi, XEvent * ev)
m = mi->menu; m = mi->menu;
#if 0 /* FIXME - TBD */
PagerHideAllHi();
#endif
if ((win == mi->icon_win) && (ev->xcrossing.detail == NotifyAncestor)) if ((win == mi->icon_win) && (ev->xcrossing.detail == NotifyAncestor))
goto done; goto done;
if ((win == mi->win) && (ev->xcrossing.detail == NotifyInferior)) if ((win == mi->win) && (ev->xcrossing.detail == NotifyInferior))

View File

@ -145,7 +145,6 @@ ActionMoveEnd(EWin * ewin)
EoChangeOpacity(ewin, ewin->ewmh.opacity); EoChangeOpacity(ewin, ewin->ewmh.opacity);
RaiseEwin(gwins[i]); RaiseEwin(gwins[i]);
} }
StackDesktop(EoGetDesk(ewin)); /* Restack to "un-float" */
ecore_x_sync(); ecore_x_sync();
if (Conf.movres.mode_move > 0) if (Conf.movres.mode_move > 0)

View File

@ -1046,10 +1046,10 @@ PagerHiwinCreate(void)
return NULL; return NULL;
win = ECreateWindow(VRoot.win, 0, 0, 3, 3, 1); win = ECreateWindow(VRoot.win, 0, 0, 3, 3, 1);
EobjInit(&phi->o, EOBJ_TYPE_MISC, win, 0, 0, 3, 3, "HiWin");
EoSetShadow(phi, 0); EoSetShadow(phi, 0);
EoSetFloating(phi, 1); EoSetFloating(phi, 1);
EoSetLayer(phi, 19); EoSetLayer(phi, 19);
EobjInit(&phi->o, EOBJ_TYPE_MISC, win, 0, 0, 3, 3, "HiWin");
EventCallbackRegister(EoGetWin(phi), 0, PagerHiwinEvent, phi); EventCallbackRegister(EoGetWin(phi), 0, PagerHiwinEvent, phi);
ESelectInput(EoGetWin(phi), ESelectInput(EoGetWin(phi),
ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
@ -1273,7 +1273,7 @@ PagerHiwinZoom(Pager * p, EWin * ewin, int x, int y, int w, int h)
Mode_pagers.zoom = 2; Mode_pagers.zoom = 2;
EoMoveResize(phi, x, y, w, h); EoMoveResize(phi, x, y, w, h);
EoMap(phi, 1); EoMap(phi, 0);
} }
else else
{ {

View File

@ -188,9 +188,9 @@ ProgressbarShow(Progressbar * p)
ImageclassApply(p->ipc, p->p_win->win, w, p->h, 1, 0, STATE_NORMAL, 0, ImageclassApply(p->ipc, p->p_win->win, w, p->h, 1, 0, STATE_NORMAL, 0,
ST_UNKNWN); ST_UNKNWN);
EobjMap(p->win, 1); EobjMap(p->win, 0);
EobjMap(p->n_win, 1); EobjMap(p->n_win, 0);
EobjMap(p->p_win, 1); EobjMap(p->p_win, 0);
ecore_x_sync(); ecore_x_sync();
TextclassApply(p->ic, p->win->win, p->w - (p->h * 5), p->h, 0, 0, TextclassApply(p->ic, p->win->win, p->w - (p->h * 5), p->h, 0, 0,
STATE_NORMAL, 0, p->tc, p->win->name); STATE_NORMAL, 0, p->tc, p->win->name);

View File

@ -107,8 +107,8 @@ EobjListAdd(EobjList * ewl, EObj * eo, int ontop)
ewl->nwins++; ewl->nwins++;
EobjListLower(ewl, eo); EobjListLower(ewl, eo);
} }
if (eo->stacked == 0)
DeskSetDirtyStack(eo->desk); DeskSetDirtyStack(eo->desk);
} }
else else
{ {
@ -180,14 +180,14 @@ EobjListLower(EobjList * ewl, EObj * eo)
{ {
memmove(ewl->list + i, ewl->list + i + 1, n * sizeof(EObj *)); memmove(ewl->list + i, ewl->list + i + 1, n * sizeof(EObj *));
ewl->list[j] = eo; ewl->list[j] = eo;
if (ewl->layered) if (ewl->layered && eo->stacked > 0)
DeskSetDirtyStack(eo->desk); DeskSetDirtyStack(eo->desk);
} }
else if (n < 0) else if (n < 0)
{ {
memmove(ewl->list + j + 1, ewl->list + j, -n * sizeof(EObj *)); memmove(ewl->list + j + 1, ewl->list + j, -n * sizeof(EObj *));
ewl->list[j] = eo; ewl->list[j] = eo;
if (ewl->layered) if (ewl->layered && eo->stacked > 0)
DeskSetDirtyStack(eo->desk); DeskSetDirtyStack(eo->desk);
} }
@ -221,14 +221,14 @@ EobjListRaise(EobjList * ewl, EObj * eo)
{ {
memmove(ewl->list + i, ewl->list + i + 1, n * sizeof(EObj *)); memmove(ewl->list + i, ewl->list + i + 1, n * sizeof(EObj *));
ewl->list[j] = eo; ewl->list[j] = eo;
if (ewl->layered) if (ewl->layered && eo->stacked > 0)
DeskSetDirtyStack(eo->desk); DeskSetDirtyStack(eo->desk);
} }
else if (n < 0) else if (n < 0)
{ {
memmove(ewl->list + j + 1, ewl->list + j, -n * sizeof(EObj *)); memmove(ewl->list + j + 1, ewl->list + j, -n * sizeof(EObj *));
ewl->list[j] = eo; ewl->list[j] = eo;
if (ewl->layered) if (ewl->layered && eo->stacked > 0)
DeskSetDirtyStack(eo->desk); DeskSetDirtyStack(eo->desk);
} }

View File

@ -557,7 +557,7 @@ TooltipShow(ToolTip * tt, const char *text, ActionClass * ac, int x, int y)
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
if (tt->win[i]) if (tt->win[i])
EobjMap(tt->win[i], 1); EobjMap(tt->win[i], 0);
ecore_x_sync(); ecore_x_sync();

View File

@ -153,7 +153,7 @@ WarpFocusShow(EWin * ewin)
} }
PropagateShapes(warpFocusWindow->win); PropagateShapes(warpFocusWindow->win);
EobjMap(warpFocusWindow, 1); EobjMap(warpFocusWindow, 0);
/* /*
* Grab the keyboard. The grab is automatically released when * Grab the keyboard. The grab is automatically released when