Fri Oct 1 17:01:44 PDT 1999
(Mandrake) let us place dialog boxes arranged like the rest of the windows in the world SVN revision: 555
This commit is contained in:
parent
6e5a379140
commit
0e6abdc9eb
|
@ -2689,3 +2689,10 @@ Fri Oct 1 16:19:08 PDT 1999
|
|||
(Raster)
|
||||
|
||||
commit updated TODO
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Fri Oct 1 17:01:44 PDT 1999
|
||||
(Mandrake)
|
||||
|
||||
let us place dialog boxes arranged like the rest of the windows in the world
|
||||
|
|
2
src/E.h
2
src/E.h
|
@ -2526,6 +2526,8 @@ void MoveEwinLinearAreaBy(EWin * ewin, int a);
|
|||
int Emkstemp(char *template);
|
||||
void SnapEwin(EWin * ewin, int dx, int dy, int *new_dx,
|
||||
int *new_dy);
|
||||
void ArrangeEwin(EWin * ewin);
|
||||
|
||||
void SessionInit(void);
|
||||
void SessionSave(int shutdown);
|
||||
void doSMExit(void *params);
|
||||
|
|
127
src/arrange.c
127
src/arrange.c
|
@ -728,3 +728,130 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
|
|||
*new_dy = dy;
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
void
|
||||
ArrangeEwin(EWin * ewin)
|
||||
{
|
||||
|
||||
EWin **lst;
|
||||
Button **blst;
|
||||
int i, j, num;
|
||||
RectBox *fixed, *ret, newrect;
|
||||
|
||||
ewin->client.already_placed = 1;
|
||||
lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
|
||||
if ((lst) && (num > 0))
|
||||
{
|
||||
fixed = Emalloc(sizeof(RectBox) * num);
|
||||
ret = Emalloc(sizeof(RectBox) * (num + 1));
|
||||
j = 0;
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if ((lst[i] != ewin) && (!lst[i]->iconified) &&
|
||||
(!lst[i]->ignorearrange) && (lst[i]->layer != 0) &&
|
||||
(((lst[i]->area_x == desks.desk[ewin->desktop].current_area_x) &&
|
||||
(lst[i]->area_y == desks.desk[ewin->desktop].current_area_y) &&
|
||||
(lst[i]->desktop == ewin->desktop)) ||
|
||||
(lst[i]->sticky)))
|
||||
{
|
||||
fixed[j].data = lst[i];
|
||||
fixed[j].x = (lst[i])->x;
|
||||
fixed[j].y = (lst[i])->y;
|
||||
fixed[j].w = (lst[i])->w;
|
||||
fixed[j].h = (lst[i])->h;
|
||||
if (fixed[j].x < 0)
|
||||
{
|
||||
fixed[j].x += fixed[j].w;
|
||||
fixed[j].x = 0;
|
||||
}
|
||||
if ((fixed[j].x + fixed[j].w) > root.w)
|
||||
fixed[j].w = root.w - fixed[j].x;
|
||||
if (fixed[j].y < 0)
|
||||
{
|
||||
fixed[j].y += fixed[j].h;
|
||||
fixed[j].y = 0;
|
||||
}
|
||||
if ((fixed[j].y + fixed[j].h) > root.h)
|
||||
fixed[j].h = root.h - fixed[j].y;
|
||||
if ((fixed[j].w > 0) && (fixed[j].h > 0))
|
||||
{
|
||||
if (!(lst[i])->never_use_area)
|
||||
fixed[j].p = (lst[i])->layer;
|
||||
else
|
||||
fixed[j].p = 50;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
blst = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
|
||||
if (blst)
|
||||
{
|
||||
fixed = Erealloc(fixed, sizeof(RectBox) * (num + j));
|
||||
ret = Erealloc(ret, sizeof(RectBox) * ((num + j) + 1));
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if (((blst[i]->desktop == ewin->desktop) ||
|
||||
((blst[i]->desktop == 0) && (blst[i]->sticky))) &&
|
||||
(blst[i]->visible))
|
||||
{
|
||||
fixed[j].data = NULL;
|
||||
fixed[j].x = blst[i]->x;
|
||||
fixed[j].y = blst[i]->y;
|
||||
fixed[j].w = blst[i]->w;
|
||||
fixed[j].h = blst[i]->h;
|
||||
if (fixed[j].x < 0)
|
||||
{
|
||||
fixed[j].x += fixed[j].w;
|
||||
fixed[j].x = 0;
|
||||
}
|
||||
if ((fixed[j].x + fixed[j].w) > root.w)
|
||||
fixed[j].w = root.w - fixed[j].x;
|
||||
if (fixed[j].y < 0)
|
||||
{
|
||||
fixed[j].y += fixed[j].h;
|
||||
fixed[j].y = 0;
|
||||
}
|
||||
if ((fixed[j].y + fixed[j].h) > root.h)
|
||||
fixed[j].h = root.h - fixed[j].y;
|
||||
if ((fixed[j].w > 0) && (fixed[j].h > 0))
|
||||
{
|
||||
if (blst[i]->sticky)
|
||||
fixed[j].p = 50;
|
||||
else
|
||||
fixed[j].p = 0;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Efree(blst);
|
||||
}
|
||||
newrect.data = ewin;
|
||||
newrect.x = 0;
|
||||
newrect.y = 0;
|
||||
newrect.w = ewin->w;
|
||||
newrect.h = ewin->h;
|
||||
newrect.p = ewin->layer;
|
||||
ArrangeRects(fixed, j, &newrect, 1, ret, root.w, root.h, ARRANGE_BY_SIZE);
|
||||
for (i = 0; i < j + 1; i++)
|
||||
{
|
||||
if (ret[i].data == ewin)
|
||||
{
|
||||
ewin->x = ret[i].x;
|
||||
ewin->y = ret[i].y;
|
||||
i = j + 1;
|
||||
}
|
||||
}
|
||||
Efree(lst);
|
||||
if (ret)
|
||||
Efree(ret);
|
||||
if (fixed)
|
||||
Efree(fixed);
|
||||
}
|
||||
else
|
||||
{
|
||||
ewin->x = (root.w - ewin->w) >> 1;
|
||||
ewin->y = (root.h - ewin->h) >> 1;
|
||||
}
|
||||
MoveEwin(ewin, ewin->x, ewin->y);
|
||||
|
||||
}
|
||||
|
|
|
@ -142,7 +142,6 @@ GetFocusEwin(void)
|
|||
}
|
||||
EDBUG_RETURN(mode.realfocuswin);
|
||||
}
|
||||
|
||||
if (mode.borderpartpress)
|
||||
{
|
||||
if (mode.context_ewin)
|
||||
|
@ -154,7 +153,6 @@ GetFocusEwin(void)
|
|||
EDBUG_RETURN(mode.realfocuswin);
|
||||
}
|
||||
}
|
||||
|
||||
if (mode.mode != MODE_NONE)
|
||||
EDBUG_RETURN(GetEwin());
|
||||
|
||||
|
@ -1295,7 +1293,6 @@ AdoptInternal(Window win, Border * border, int type, void *ptr)
|
|||
else
|
||||
SetEwinBorder(ewin);
|
||||
}
|
||||
|
||||
b = ewin->border;
|
||||
ewin->border = NULL;
|
||||
ewin->border_new = 1;
|
||||
|
@ -1558,7 +1555,6 @@ FreeEwin(EWin * ewin)
|
|||
for (i = 0; i < num_groups; i++)
|
||||
RemoveEwinFromGroup(ewin, ewin->groups[0]);
|
||||
}
|
||||
|
||||
Efree(ewin);
|
||||
|
||||
EDBUG_RETURN_;
|
||||
|
|
|
@ -590,11 +590,11 @@ ShowDialog(Dialog * d)
|
|||
}
|
||||
else
|
||||
{
|
||||
MoveEwin(ewin, (root.w - ewin->w) / 2, (root.h - ewin->h) / 2);
|
||||
ArrangeEwin(ewin);
|
||||
}
|
||||
}
|
||||
else
|
||||
MoveEwin(ewin, (root.w - ewin->w) / 2, (root.h - ewin->h) / 2);
|
||||
ArrangeEwin(ewin);
|
||||
RestackEwin(ewin);
|
||||
ShowEwin(ewin);
|
||||
ewin->dialog = d;
|
||||
|
|
Loading…
Reference in New Issue