parent
bbee671e2f
commit
90001a2bfa
17
src/E.h
17
src/E.h
|
@ -523,7 +523,7 @@ struct _eobj
|
||||||
#define EoGetH(eo) ((eo)->o.h)
|
#define EoGetH(eo) ((eo)->o.h)
|
||||||
#define EoIsSticky(eo) ((eo)->o.sticky)
|
#define EoIsSticky(eo) ((eo)->o.sticky)
|
||||||
#define EoIsFloating(eo) ((eo)->o.floating)
|
#define EoIsFloating(eo) ((eo)->o.floating)
|
||||||
#define EoGetDesk(eo) EobjGetDesk(&((eo)->o))
|
#define EoGetDesk(eo) ((eo)->o.desk)
|
||||||
#define EoGetLayer(eo) ((eo)->o.layer)
|
#define EoGetLayer(eo) ((eo)->o.layer)
|
||||||
#define EoGetPixmap(eo) EobjGetPixmap(&((eo)->o))
|
#define EoGetPixmap(eo) EobjGetPixmap(&((eo)->o))
|
||||||
|
|
||||||
|
@ -674,11 +674,12 @@ WinClient;
|
||||||
struct _ewin
|
struct _ewin
|
||||||
{
|
{
|
||||||
EObj o;
|
EObj o;
|
||||||
int shape_x, shape_y;
|
|
||||||
int req_x, req_y;
|
|
||||||
int lx, ly, lw, lh, ll;
|
|
||||||
char type;
|
char type;
|
||||||
char state;
|
char state;
|
||||||
|
int ld; /* Last desk */
|
||||||
|
int lx, ly; /* Last pos */
|
||||||
|
int lw, lh; /* Last size */
|
||||||
|
int ll; /* Last layer */
|
||||||
char toggle;
|
char toggle;
|
||||||
Window win_container;
|
Window win_container;
|
||||||
WinClient client;
|
WinClient client;
|
||||||
|
@ -686,9 +687,8 @@ struct _ewin
|
||||||
const Border *normal_border;
|
const Border *normal_border;
|
||||||
const Border *previous_border;
|
const Border *previous_border;
|
||||||
EWinBit *bits;
|
EWinBit *bits;
|
||||||
int flags;
|
|
||||||
Group **groups;
|
|
||||||
int num_groups;
|
int num_groups;
|
||||||
|
Group **groups;
|
||||||
char visibility;
|
char visibility;
|
||||||
char docked;
|
char docked;
|
||||||
char shown;
|
char shown;
|
||||||
|
@ -752,6 +752,8 @@ struct _ewin
|
||||||
char *wm_name;
|
char *wm_name;
|
||||||
char *wm_icon_name;
|
char *wm_icon_name;
|
||||||
} ewmh;
|
} ewmh;
|
||||||
|
int shape_x, shape_y;
|
||||||
|
int req_x, req_y;
|
||||||
void (*MoveResize) (EWin * ewin, int resize);
|
void (*MoveResize) (EWin * ewin, int resize);
|
||||||
void (*Refresh) (EWin * ewin);
|
void (*Refresh) (EWin * ewin);
|
||||||
void (*Close) (EWin * ewin);
|
void (*Close) (EWin * ewin);
|
||||||
|
@ -1354,6 +1356,7 @@ void DeskGetArea(int desk, int *ax, int *ay);
|
||||||
void DeskSetArea(int desk, int ax, int ay);
|
void DeskSetArea(int desk, int ax, int ay);
|
||||||
int DeskIsViewable(int desk);
|
int DeskIsViewable(int desk);
|
||||||
void DeskSetViewable(int desk, int on);
|
void DeskSetViewable(int desk, int on);
|
||||||
|
void DeskSetDirtyStack(int desk);
|
||||||
void DeskGetCurrentArea(int *ax, int *ay);
|
void DeskGetCurrentArea(int *ax, int *ay);
|
||||||
Window DeskGetCurrentRoot(void);
|
Window DeskGetCurrentRoot(void);
|
||||||
void DeskSetCurrentArea(int ax, int ay);
|
void DeskSetCurrentArea(int ax, int ay);
|
||||||
|
@ -1369,8 +1372,6 @@ void DesksRefresh(void);
|
||||||
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 DeskRaise(int num);
|
|
||||||
void DeskLower(int num);
|
|
||||||
void DeskMove(int num, int x, int y);
|
void DeskMove(int num, int x, int y);
|
||||||
void DeskHide(int num);
|
void DeskHide(int num);
|
||||||
void DeskShow(int num);
|
void DeskShow(int num);
|
||||||
|
|
|
@ -150,7 +150,6 @@ ButtonCreate(const char *name, int id, ImageClass * iclass,
|
||||||
EoSetShadow(b, 0);
|
EoSetShadow(b, 0);
|
||||||
|
|
||||||
EobjListStackAdd(&b->o, 0);
|
EobjListStackAdd(&b->o, 0);
|
||||||
EwinListStackRaise(b);
|
|
||||||
|
|
||||||
AddItem(b, b->name, id, LIST_TYPE_BUTTON);
|
AddItem(b, b->name, id, LIST_TYPE_BUTTON);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ typedef struct
|
||||||
EObj o;
|
EObj o;
|
||||||
int num;
|
int num;
|
||||||
char viewable;
|
char viewable;
|
||||||
|
char dirty_stack;
|
||||||
Background *bg;
|
Background *bg;
|
||||||
Button *tag;
|
Button *tag;
|
||||||
int current_area_x;
|
int current_area_x;
|
||||||
|
@ -46,11 +47,14 @@ typedef struct
|
||||||
typedef struct _desktops
|
typedef struct _desktops
|
||||||
{
|
{
|
||||||
int current;
|
int current;
|
||||||
|
int previous;
|
||||||
Desk *desk[ENLIGHTENMENT_CONF_NUM_DESKTOPS];
|
Desk *desk[ENLIGHTENMENT_CONF_NUM_DESKTOPS];
|
||||||
int order[ENLIGHTENMENT_CONF_NUM_DESKTOPS];
|
int order[ENLIGHTENMENT_CONF_NUM_DESKTOPS];
|
||||||
}
|
}
|
||||||
Desktops;
|
Desktops;
|
||||||
|
|
||||||
|
static void DeskRaise(int num);
|
||||||
|
static void DeskLower(int num);
|
||||||
static void DesktopHandleEvents(XEvent * ev, void *prm);
|
static void DesktopHandleEvents(XEvent * ev, void *prm);
|
||||||
|
|
||||||
/* The desktops */
|
/* The desktops */
|
||||||
|
@ -308,6 +312,9 @@ DeskControlsCreate(Desk * d)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Restack buttons - Hmmm. */
|
||||||
|
StackDesktop(d->num);
|
||||||
|
|
||||||
d->tag = b;
|
d->tag = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,6 +557,17 @@ DeskSetViewable(int desk, int on)
|
||||||
_DeskGet(desk)->viewable = on;
|
_DeskGet(desk)->viewable = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DeskSetDirtyStack(int desk)
|
||||||
|
{
|
||||||
|
Desk *d = _DeskGet(desk);
|
||||||
|
|
||||||
|
if (!d)
|
||||||
|
return;
|
||||||
|
|
||||||
|
d->dirty_stack++;
|
||||||
|
}
|
||||||
|
|
||||||
Window
|
Window
|
||||||
DeskGetCurrentRoot(void)
|
DeskGetCurrentRoot(void)
|
||||||
{
|
{
|
||||||
|
@ -591,6 +609,8 @@ DesksInit(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
desks.previous = -1;
|
||||||
|
|
||||||
for (i = 0; i < Conf.desks.num; i++)
|
for (i = 0; i < Conf.desks.num; i++)
|
||||||
DeskCreate(i, 0);
|
DeskCreate(i, 0);
|
||||||
}
|
}
|
||||||
|
@ -603,9 +623,6 @@ DesksResize(int w, int h)
|
||||||
for (i = 0; i < Conf.desks.num; i++)
|
for (i = 0; i < Conf.desks.num; i++)
|
||||||
DeskResize(i, w, h);
|
DeskResize(i, w, h);
|
||||||
|
|
||||||
/* Restack buttons - Hmmm. */
|
|
||||||
StackDesktops();
|
|
||||||
|
|
||||||
ModulesSignal(ESIGNAL_DESK_RESIZE, NULL);
|
ModulesSignal(ESIGNAL_DESK_RESIZE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,8 +648,10 @@ ChangeNumberOfDesktops(int quantity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pnum = Conf.desks.num;
|
pnum = Conf.desks.num;
|
||||||
|
|
||||||
for (i = quantity; i < Conf.desks.num; i++)
|
for (i = quantity; i < Conf.desks.num; i++)
|
||||||
DeskLower(i);
|
DeskLower(i);
|
||||||
|
|
||||||
Conf.desks.num = quantity;
|
Conf.desks.num = quantity;
|
||||||
|
|
||||||
if (Conf.desks.num > pnum)
|
if (Conf.desks.num > pnum)
|
||||||
|
@ -708,9 +727,6 @@ DesksControlsRefresh(void)
|
||||||
DesksControlsCreate();
|
DesksControlsCreate();
|
||||||
DesksControlsShow();
|
DesksControlsShow();
|
||||||
|
|
||||||
/* Restack buttons - Hmmm. */
|
|
||||||
StackDesktops();
|
|
||||||
|
|
||||||
autosave();
|
autosave();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -972,7 +988,6 @@ MoveStickyButtonsToCurrentDesk(void)
|
||||||
void
|
void
|
||||||
DeskGoto(int desk)
|
DeskGoto(int desk)
|
||||||
{
|
{
|
||||||
static int pdesk = -1;
|
|
||||||
Desk *d;
|
Desk *d;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
@ -983,7 +998,7 @@ DeskGoto(int desk)
|
||||||
else if (desk < 0)
|
else if (desk < 0)
|
||||||
desk = Conf.desks.num - 1;
|
desk = Conf.desks.num - 1;
|
||||||
}
|
}
|
||||||
if (desk < 0 || desk >= Conf.desks.num || desk == pdesk)
|
if (desk < 0 || desk >= Conf.desks.num || desk == desks.previous)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (EventDebug(EDBUG_TYPE_DESKS))
|
if (EventDebug(EDBUG_TYPE_DESKS))
|
||||||
|
@ -1066,7 +1081,6 @@ DeskGoto(int desk)
|
||||||
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
|
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
|
||||||
|
|
||||||
HandleDrawQueue();
|
HandleDrawQueue();
|
||||||
pdesk = DesksGetCurrent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1182,7 +1196,7 @@ UncoverDesktop(int desk)
|
||||||
EMapWindow(EoGetWin(d));
|
EMapWindow(EoGetWin(d));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
DeskRaise(int desk)
|
DeskRaise(int desk)
|
||||||
{
|
{
|
||||||
Desk *d;
|
Desk *d;
|
||||||
|
@ -1193,38 +1207,41 @@ DeskRaise(int desk)
|
||||||
|
|
||||||
d = _DeskGet(desk);
|
d = _DeskGet(desk);
|
||||||
|
|
||||||
if (EventDebug(EDBUG_TYPE_DESKS))
|
|
||||||
Eprintf("DeskRaise %d\n", desk);
|
|
||||||
|
|
||||||
FocusNewDeskBegin();
|
FocusNewDeskBegin();
|
||||||
d->viewable = 1;
|
d->viewable = 1;
|
||||||
DeskRefresh(desk);
|
DeskRefresh(desk);
|
||||||
MoveToDeskTop(desk);
|
MoveToDeskTop(desk);
|
||||||
|
|
||||||
|
if (EventDebug(EDBUG_TYPE_DESKS))
|
||||||
|
Eprintf("DeskRaise(%d) current=%d\n", desk, desks.current);
|
||||||
|
|
||||||
|
desks.previous = desks.current = desk;
|
||||||
|
|
||||||
if (desk == 0)
|
if (desk == 0)
|
||||||
{
|
{
|
||||||
for (i = Conf.desks.num - 1; i > 0; i--)
|
for (i = Conf.desks.num - 1; i > 0; i--)
|
||||||
{
|
DeskHide(desks.order[i]);
|
||||||
DeskHide(desks.order[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EMapWindow(EoGetWin(d));
|
||||||
|
}
|
||||||
|
|
||||||
StackDesktops();
|
StackDesktops();
|
||||||
desks.current = desk;
|
|
||||||
MoveStickyWindowsToCurrentDesk();
|
MoveStickyWindowsToCurrentDesk();
|
||||||
MoveStickyButtonsToCurrentDesk();
|
MoveStickyButtonsToCurrentDesk();
|
||||||
StackDesktop(DesksGetCurrent());
|
StackDesktop(DesksGetCurrent());
|
||||||
FocusNewDesk();
|
FocusNewDesk();
|
||||||
#if 0 /* FIXME - TBD */
|
|
||||||
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
|
|
||||||
#endif
|
|
||||||
if (Mode.mode == MODE_NONE)
|
if (Mode.mode == MODE_NONE)
|
||||||
HandleDrawQueue();
|
{
|
||||||
|
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
|
||||||
|
HandleDrawQueue();
|
||||||
|
}
|
||||||
HintsSetCurrentDesktop();
|
HintsSetCurrentDesktop();
|
||||||
EMapWindow(EoGetWin(d));
|
|
||||||
ecore_x_sync();
|
ecore_x_sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
DeskLower(int desk)
|
DeskLower(int desk)
|
||||||
{
|
{
|
||||||
if ((desk <= 0) || (desk >= Conf.desks.num))
|
if ((desk <= 0) || (desk >= Conf.desks.num))
|
||||||
|
@ -1232,19 +1249,25 @@ DeskLower(int desk)
|
||||||
|
|
||||||
FocusNewDeskBegin();
|
FocusNewDeskBegin();
|
||||||
MoveToDeskBottom(desk);
|
MoveToDeskBottom(desk);
|
||||||
|
|
||||||
|
if (EventDebug(EDBUG_TYPE_DESKS))
|
||||||
|
Eprintf("DeskLower(%d) %d -> %d\n", desk, desks.current, desks.order[0]);
|
||||||
|
|
||||||
|
desks.previous = desks.current = desks.order[0];
|
||||||
|
|
||||||
UncoverDesktop(desks.order[0]);
|
UncoverDesktop(desks.order[0]);
|
||||||
DeskHide(desk);
|
DeskHide(desk);
|
||||||
|
|
||||||
StackDesktops();
|
StackDesktops();
|
||||||
desks.current = desks.order[0];
|
|
||||||
MoveStickyWindowsToCurrentDesk();
|
MoveStickyWindowsToCurrentDesk();
|
||||||
MoveStickyButtonsToCurrentDesk();
|
MoveStickyButtonsToCurrentDesk();
|
||||||
StackDesktop(DesksGetCurrent());
|
StackDesktop(DesksGetCurrent());
|
||||||
FocusNewDesk();
|
FocusNewDesk();
|
||||||
#if 0 /* FIXME - TBD */
|
|
||||||
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
|
|
||||||
#endif
|
|
||||||
if (Mode.mode == MODE_NONE)
|
if (Mode.mode == MODE_NONE)
|
||||||
HandleDrawQueue();
|
{
|
||||||
|
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
|
||||||
|
HandleDrawQueue();
|
||||||
|
}
|
||||||
HintsSetCurrentDesktop();
|
HintsSetCurrentDesktop();
|
||||||
ecore_x_sync();
|
ecore_x_sync();
|
||||||
}
|
}
|
||||||
|
@ -1388,11 +1411,11 @@ StackDesktop(int desk)
|
||||||
void
|
void
|
||||||
DeskGotoByEwin(EWin * ewin)
|
DeskGotoByEwin(EWin * ewin)
|
||||||
{
|
{
|
||||||
if (!EoIsSticky(ewin))
|
if (EoIsSticky(ewin) || EoIsFloating(ewin))
|
||||||
{
|
return;
|
||||||
DeskGoto(EoGetDesk(ewin));
|
|
||||||
SetCurrentArea(ewin->area_x, ewin->area_y);
|
DeskGoto(EoGetDesk(ewin));
|
||||||
}
|
SetCurrentArea(ewin->area_x, ewin->area_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char sentpress = 0;
|
static char sentpress = 0;
|
||||||
|
|
|
@ -54,7 +54,9 @@ EobjSetDesk(EObj * eo, int desk)
|
||||||
eo->desk = desk;
|
eo->desk = desk;
|
||||||
break;
|
break;
|
||||||
case EOBJ_TYPE_EWIN:
|
case EOBJ_TYPE_EWIN:
|
||||||
if (eo->sticky || eo->floating || eo->desk < 0)
|
if (eo->floating)
|
||||||
|
eo->desk = 0;
|
||||||
|
else if (eo->sticky || eo->desk < 0)
|
||||||
eo->desk = DesksGetCurrent();
|
eo->desk = DesksGetCurrent();
|
||||||
else
|
else
|
||||||
eo->desk = desk % Conf.desks.num;
|
eo->desk = desk % Conf.desks.num;
|
||||||
|
@ -128,6 +130,7 @@ EobjSetFloating(EObj * eo, int floating)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
eo->floating = floating;
|
eo->floating = floating;
|
||||||
|
eo->desk = 0;
|
||||||
EobjSetLayer(eo, eo->layer);
|
EobjSetLayer(eo, eo->layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1285,18 +1285,15 @@ MoveEwinToDesktopAt(EWin * ewin, int desk, int x, int y)
|
||||||
EoGetDesk(ewin), desk);
|
EoGetDesk(ewin), desk);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pdesk = EoGetDesk(ewin);
|
pdesk = ewin->ld;
|
||||||
desk = desk % Conf.desks.num;
|
desk = desk % Conf.desks.num;
|
||||||
|
EoSetDesk(ewin, desk);
|
||||||
|
|
||||||
if (desk != pdesk && !EoIsSticky(ewin))
|
if (desk != pdesk && !EoIsSticky(ewin))
|
||||||
{
|
{
|
||||||
#if 0 /* Not necessary when the the _XROOT... atoms are initially set on each desk */
|
|
||||||
/* Refresh bg before apps are planted so they can pick it up */
|
|
||||||
DeskSetViewable(desk, 1);
|
|
||||||
DeskRefresh(desk);
|
|
||||||
#endif
|
|
||||||
EoSetDesk(ewin, desk);
|
|
||||||
SnapshotEwinUpdate(ewin, SNAP_USE_DESK);
|
SnapshotEwinUpdate(ewin, SNAP_USE_DESK);
|
||||||
ModulesSignal(ESIGNAL_DESK_CHANGE, (void *)pdesk);
|
if (pdesk >= 0)
|
||||||
|
ModulesSignal(ESIGNAL_DESK_CHANGE, (void *)pdesk);
|
||||||
}
|
}
|
||||||
|
|
||||||
dx = x - EoGetX(ewin);
|
dx = x - EoGetX(ewin);
|
||||||
|
|
12
src/ewins.c
12
src/ewins.c
|
@ -67,6 +67,7 @@ EwinCreate(Window win, int type)
|
||||||
|
|
||||||
ewin->type = type;
|
ewin->type = type;
|
||||||
ewin->state = (Mode.wm.startup) ? EWIN_STATE_STARTUP : EWIN_STATE_NEW;
|
ewin->state = (Mode.wm.startup) ? EWIN_STATE_STARTUP : EWIN_STATE_NEW;
|
||||||
|
ewin->ld = -1;
|
||||||
ewin->lx = -1;
|
ewin->lx = -1;
|
||||||
ewin->ly = -1;
|
ewin->ly = -1;
|
||||||
ewin->lw = -1;
|
ewin->lw = -1;
|
||||||
|
@ -837,10 +838,12 @@ AddToFamily(EWin * ewin, Window win)
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
Window junk, root_return;
|
Window junk, root_return;
|
||||||
|
|
||||||
|
#if 0 /* FIXME: Disable for now */
|
||||||
/* if the loser has manual placement on and the app asks to be on */
|
/* if the loser has manual placement on and the app asks to be on */
|
||||||
/* a desktop, then send E to that desktop so the user can place */
|
/* a desktop, then send E to that desktop so the user can place */
|
||||||
/* the window there */
|
/* the window there */
|
||||||
DeskGoto(desk);
|
DeskGoto(desk);
|
||||||
|
#endif
|
||||||
|
|
||||||
XQueryPointer(disp, VRoot.win, &root_return, &junk, &rx, &ry, &wx, &wy,
|
XQueryPointer(disp, VRoot.win, &root_return, &junk, &rx, &ry, &wx, &wy,
|
||||||
&mask);
|
&mask);
|
||||||
|
@ -1410,9 +1413,14 @@ FloatEwinAt(EWin * ewin, int x, int y)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (EoIsFloating(ewin))
|
if (EoIsFloating(ewin))
|
||||||
EoSetFloating(ewin, 2);
|
{
|
||||||
|
EoSetFloating(ewin, 2);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
EoSetFloating(ewin, 1);
|
{
|
||||||
|
ewin->ld = EoGetDesk(ewin);
|
||||||
|
EoSetFloating(ewin, 1);
|
||||||
|
}
|
||||||
|
|
||||||
dx = x - EoGetX(ewin);
|
dx = x - EoGetX(ewin);
|
||||||
dy = y - EoGetY(ewin);
|
dy = y - EoGetY(ewin);
|
||||||
|
|
|
@ -104,8 +104,6 @@ ActionMoveEnd(EWin * ewin)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
d = DesktopAt(Mode.x, Mode.y);
|
|
||||||
|
|
||||||
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup
|
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup
|
||||||
|| Mode.move.swap, &num);
|
|| Mode.move.swap, &num);
|
||||||
|
|
||||||
|
@ -124,6 +122,8 @@ ActionMoveEnd(EWin * ewin)
|
||||||
}
|
}
|
||||||
Mode.mode = MODE_NONE;
|
Mode.mode = MODE_NONE;
|
||||||
|
|
||||||
|
d = DesktopAt(Mode.x, Mode.y);
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
if ((EoIsFloating(gwins[i])) || (Conf.movres.mode_move > 0))
|
if ((EoIsFloating(gwins[i])) || (Conf.movres.mode_move > 0))
|
||||||
|
|
|
@ -35,8 +35,12 @@ struct _eobjlist
|
||||||
int nalloc;
|
int nalloc;
|
||||||
int nwins;
|
int nwins;
|
||||||
EObj **list;
|
EObj **list;
|
||||||
|
char layered;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int EobjListRaise(EobjList * ewl, EObj * eo);
|
||||||
|
static int EobjListLower(EobjList * ewl, EObj * eo);
|
||||||
|
|
||||||
#if ENABLE_DEBUG_STACKING
|
#if ENABLE_DEBUG_STACKING
|
||||||
static void
|
static void
|
||||||
EobjListShow(const char *txt, EobjList * ewl)
|
EobjListShow(const char *txt, EobjList * ewl)
|
||||||
|
@ -52,8 +56,7 @@ EobjListShow(const char *txt, EobjList * ewl)
|
||||||
{
|
{
|
||||||
eo = ewl->list[i];
|
eo = ewl->list[i];
|
||||||
Eprintf(" %2d: %#10lx %#10lx %d %d %s\n", i, eo->win,
|
Eprintf(" %2d: %#10lx %#10lx %d %d %s\n", i, eo->win,
|
||||||
EobjGetCwin(eo), eo->desk,
|
EobjGetCwin(eo), eo->desk, eo->ilayer, EobjGetName(eo));
|
||||||
(eo->floating) ? 999 : eo->ilayer, EobjGetName(eo));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -88,14 +91,34 @@ EobjListAdd(EobjList * ewl, EObj * eo, int ontop)
|
||||||
ewl->list = (EObj **) Erealloc(ewl->list, ewl->nalloc * sizeof(EObj *));
|
ewl->list = (EObj **) Erealloc(ewl->list, ewl->nalloc * sizeof(EObj *));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ontop)
|
if (ewl->layered)
|
||||||
{
|
{
|
||||||
memmove(ewl->list + 1, ewl->list, ewl->nwins * sizeof(EObj *));
|
/* The simple way for now (add, raise/lower) */
|
||||||
ewl->list[0] = eo;
|
if (ontop)
|
||||||
|
{
|
||||||
|
ewl->list[ewl->nwins] = eo;
|
||||||
|
EobjListRaise(ewl, eo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memmove(ewl->list + 1, ewl->list, ewl->nwins * sizeof(EObj *));
|
||||||
|
ewl->list[0] = eo;
|
||||||
|
EobjListLower(ewl, eo);
|
||||||
|
}
|
||||||
|
|
||||||
|
DeskSetDirtyStack(eo->desk);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ewl->list[ewl->nwins] = eo;
|
if (ontop)
|
||||||
|
{
|
||||||
|
memmove(ewl->list + 1, ewl->list, ewl->nwins * sizeof(EObj *));
|
||||||
|
ewl->list[0] = eo;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ewl->list[ewl->nwins] = eo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ewl->nwins++;
|
ewl->nwins++;
|
||||||
|
|
||||||
|
@ -130,7 +153,7 @@ EobjListDel(EobjList * ewl, EObj * eo)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
EobjListLower(EobjList * ewl, EObj * eo, int mode)
|
EobjListLower(EobjList * ewl, EObj * eo)
|
||||||
{
|
{
|
||||||
int i, j, n;
|
int i, j, n;
|
||||||
|
|
||||||
|
@ -140,7 +163,7 @@ EobjListLower(EobjList * ewl, EObj * eo, int mode)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
j = ewl->nwins - 1;
|
j = ewl->nwins - 1;
|
||||||
if (mode)
|
if (ewl->layered)
|
||||||
{
|
{
|
||||||
/* Take the layer into account */
|
/* Take the layer into account */
|
||||||
for (; j >= 0; j--)
|
for (; j >= 0; j--)
|
||||||
|
@ -155,11 +178,15 @@ EobjListLower(EobjList * ewl, EObj * eo, int mode)
|
||||||
{
|
{
|
||||||
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)
|
||||||
|
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)
|
||||||
|
DeskSetDirtyStack(eo->desk);
|
||||||
}
|
}
|
||||||
|
|
||||||
EobjListShow("EobjListLower", ewl);
|
EobjListShow("EobjListLower", ewl);
|
||||||
|
@ -167,7 +194,7 @@ EobjListLower(EobjList * ewl, EObj * eo, int mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
EobjListRaise(EobjList * ewl, EObj * eo, int mode)
|
EobjListRaise(EobjList * ewl, EObj * eo)
|
||||||
{
|
{
|
||||||
int i, j, n;
|
int i, j, n;
|
||||||
|
|
||||||
|
@ -177,7 +204,7 @@ EobjListRaise(EobjList * ewl, EObj * eo, int mode)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
if (mode)
|
if (ewl->layered)
|
||||||
{
|
{
|
||||||
/* Take the layer into account */
|
/* Take the layer into account */
|
||||||
for (; j < ewl->nwins; j++)
|
for (; j < ewl->nwins; j++)
|
||||||
|
@ -192,11 +219,15 @@ EobjListRaise(EobjList * ewl, EObj * eo, int mode)
|
||||||
{
|
{
|
||||||
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)
|
||||||
|
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)
|
||||||
|
DeskSetDirtyStack(eo->desk);
|
||||||
}
|
}
|
||||||
|
|
||||||
EobjListShow("EobjListRaise", ewl);
|
EobjListShow("EobjListRaise", ewl);
|
||||||
|
@ -230,8 +261,8 @@ EobjListTypeCount(const EobjList * ewl, int type)
|
||||||
/*
|
/*
|
||||||
* The global stacking and focus lists
|
* The global stacking and focus lists
|
||||||
*/
|
*/
|
||||||
EobjList EwinListStack = { "Stack", 0, 0, NULL };
|
EobjList EwinListStack = { "Stack", 0, 0, NULL, 1 };
|
||||||
EobjList EwinListFocus = { "Focus", 0, 0, NULL };
|
EobjList EwinListFocus = { "Focus", 0, 0, NULL, 0 };
|
||||||
|
|
||||||
static EObj *const *
|
static EObj *const *
|
||||||
EobjListGet(EobjList * ewl, int *num)
|
EobjListGet(EobjList * ewl, int *num)
|
||||||
|
@ -279,19 +310,19 @@ EobjListFocusDel(EObj * eo)
|
||||||
int
|
int
|
||||||
EobjListStackRaise(EObj * eo)
|
EobjListStackRaise(EObj * eo)
|
||||||
{
|
{
|
||||||
return EobjListRaise(&EwinListStack, eo, 1);
|
return EobjListRaise(&EwinListStack, eo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
EobjListStackLower(EObj * eo)
|
EobjListStackLower(EObj * eo)
|
||||||
{
|
{
|
||||||
return EobjListLower(&EwinListStack, eo, 1);
|
return EobjListLower(&EwinListStack, eo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
EobjListFocusRaise(EObj * eo)
|
EobjListFocusRaise(EObj * eo)
|
||||||
{
|
{
|
||||||
return EobjListRaise(&EwinListFocus, eo, 0);
|
return EobjListRaise(&EwinListFocus, eo);
|
||||||
}
|
}
|
||||||
|
|
||||||
EWin *const *
|
EWin *const *
|
||||||
|
@ -382,7 +413,7 @@ EobjListStackGetForDesk(int *num, int desk)
|
||||||
for (i = j = 0; i < ewl->nwins; i++)
|
for (i = j = 0; i < ewl->nwins; i++)
|
||||||
{
|
{
|
||||||
eo = ewl->list[i];
|
eo = ewl->list[i];
|
||||||
if (eo->desk != desk && !eo->sticky && !eo->floating)
|
if (eo->desk != desk)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
lst[j++] = eo;
|
lst[j++] = eo;
|
||||||
|
|
Loading…
Reference in New Issue