Mostly window group management stuff & some fixes. See ChangeLog. Merging

changes with the new repo was a bit of work, I hope I haven't accidentally
thrown out anything.

Regards,
-- Christian.


SVN revision: 63
This commit is contained in:
Christian Kreibich 1999-08-20 12:23:26 +00:00
parent b94489ba37
commit fa472acb6e
22 changed files with 848 additions and 421 deletions

View File

@ -983,3 +983,32 @@ Wed Aug 4 23:08:41 PDT 1999
The beginnings of the imageclass apply IPC.
-------------------------------------------------------------------------------
Fri Aug 20 13:45:41 CEST 1999
(Christian)
Ok, quite some stuff:
:) Fixed window shading: it can now really be turned on and off.
:) Having a window shaded and switching the border to one that
shades to another direction works properly now.
:) Changed the layout management of the Remember dialog a bit to avoid
a problem that Hall Stevenson reported to the list. Also added a nice
pic ;)
:) Lots of internal changes to window groups, they're now a list type and
pointered in both directions: an ewin in a group has a pointer to a
group, the Group has a list of EWin pointers that are group members.
:) Added dialog for picking the group a window shall belong to. See
'Window Group'->'Select group to add to'. Maybe the layout could be
nicer.
:) Groups are remembered now. Therefore, pagers are no longer a group
by default, but you can make them a group and have that group be
remembered. See the 'Remember' dialog settings. Should work, but I tested
it only for a day or so.
:) I turned that menu onscreen appearance thing into an option, since
I'm not too happy with it. I'm used to just left-clicking on the
desktop for getting an Eterm, and if I do that now and the cursor
happens to be near the screen edge, I get ee or whatever. I turned
it on by default though :)
Hope you like it folks.

10
src/E.h
View File

@ -292,8 +292,9 @@ int Esnprintf(va_alist);
#define LIST_TYPE_WARP_RING 29
#define LIST_TYPE_XID 30
#define LIST_TYPE_ICONDEF 31
#define LIST_TYPE_GROUP 32
#define LIST_TYPE_COUNT 32
#define LIST_TYPE_COUNT 33
#define BEVEL_NONE 0
#define BEVEL_AMIGA 1
@ -827,7 +828,8 @@ EWin;
struct _group
{
int index;
int ref_count;
EWin **members;
int num_members;
/* these are flags that define what is applied to the whole group */
char iconify;
char kill;
@ -1078,6 +1080,7 @@ typedef struct _emode
char mapslide;
int slidespeedmap;
int slidespeedcleanup;
char animate_shading;
int shadespeed;
char doingslide;
int server_grabbed;
@ -1104,6 +1107,7 @@ typedef struct _emode
int cur_menu_depth;
Menu *cur_menu[256];
char menuslide;
char menusonscreen;
char numdesktops;
char transientsfollowleader;
char switchfortransientmap;
@ -1299,6 +1303,7 @@ struct _snapshot
char shade;
char use_cmd;
char *cmd;
int group;
char apply_to_all;
int used;
};
@ -2766,7 +2771,6 @@ extern int numlock_mask;
extern int scrollock_mask;
extern int mask_mod_combos[8];
extern Group *current_group;
extern Group *pager_group;
/* This turns on E's internal stack tracking system for coarse debugging */
/* and being able to trace E for profiling/optimisation purposes (which */

View File

@ -2853,6 +2853,7 @@ doSetWinBorder(void *params)
int i, num;
char buf[1024], has_shaded;
Border *b;
char shadechange = 0;
EDBUG(6, "doSetWinBorder");
@ -2889,7 +2890,15 @@ doSetWinBorder(void *params)
{
gwins[i]->border_new = 1;
AUDIO_PLAY("SOUND_WINDOW_BORDER_CHANGE");
if (ewin->shaded)
{
shadechange = 1;
InstantUnShadeEwin(ewin);
}
SetEwinToBorder(gwins[i], b);
if (shadechange)
InstantShadeEwin(ewin);
shadechange = 0;
ICCCM_MatchSize(gwins[i]);
MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, gwins[i]->client.w,
gwins[i]->client.h);
@ -3165,6 +3174,15 @@ doConfigure(void *params)
DIALOG_OK("Window Group Error", "\n This window does not currently \n belong to a group. \n");
}
}
else if (!strcmp(s, "group_membership"))
{
EWin *ewin = GetFocusEwin();
if (ewin)
{
ChooseGroupForEwinDialog(ewin);
}
}
}
EDBUG_RETURN(0);
}

View File

@ -1292,7 +1292,7 @@ CreateEwin()
ewin->bits = NULL;
ewin->sticky = 0;
ewin->desktop = -1;
ewin->group = 0;
ewin->group = NULL;
ewin->visible = 0;
ewin->active = 0;
ewin->iconified = 0;
@ -2544,42 +2544,43 @@ ShadeEwin(EWin * ewin)
MinShadeSize(ewin, &b, &d);
/* b = ewin->border->border.left; */
a = ewin->w;
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->w = i;
if (ewin->w < 1)
ewin->w = 1;
ww = ewin->w - ewin->border->border.left
- ewin->border->border.right;
if (ww < 1)
ww = 1;
hh = ewin->client.h;
EMoveResizeWindow(disp, ewin->win_container,
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->w = i;
if (ewin->w < 1)
ewin->w = 1;
ww = ewin->w - ewin->border->border.left
- ewin->border->border.right;
if (ww < 1)
ww = 1;
hh = ewin->client.h;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
-(ewin->client.w - ww), 0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
-(ewin->client.w - ww), 0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->shaded = 2;
ewin->w = b;
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
@ -2599,45 +2600,46 @@ ShadeEwin(EWin * ewin)
* b = ewin->border->border.right;
* c = ewin->x;
* d = ewin->x + ewin->w - ewin->border->border.right; */
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->w = i;
ewin->x = j;
ewin->reqx = j;
if (ewin->w < 1)
ewin->w = 1;
ww = ewin->w - ewin->border->border.left
- ewin->border->border.right;
if (ww < 1)
ww = 1;
hh = ewin->client.h;
EMoveResizeWindow(disp, ewin->win_container,
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->w = i;
ewin->x = j;
ewin->reqx = j;
if (ewin->w < 1)
ewin->w = 1;
ww = ewin->w - ewin->border->border.left
- ewin->border->border.right;
if (ww < 1)
ww = 1;
hh = ewin->client.h;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, 0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, 0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->shaded = 2;
ewin->w = b;
ewin->x = d;
@ -2655,41 +2657,42 @@ ShadeEwin(EWin * ewin)
MinShadeSize(ewin, &b, &d);
b = d;
/* b = ewin->border->border.top; */
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->h = i;
if (ewin->h < 1)
ewin->h = 1;
hh = ewin->h - ewin->border->border.top
- ewin->border->border.bottom;
if (hh < 1)
hh = 1;
ww = ewin->client.w;
EMoveResizeWindow(disp, ewin->win_container,
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->h = i;
if (ewin->h < 1)
ewin->h = 1;
hh = ewin->h - ewin->border->border.top
- ewin->border->border.bottom;
if (hh < 1)
hh = 1;
ww = ewin->client.w;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, -(ewin->client.h - hh),
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, -(ewin->client.h - hh),
ewin->client.win, ShapeBounding, ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->shaded = 2;
ewin->h = b;
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
@ -2710,45 +2713,46 @@ ShadeEwin(EWin * ewin)
* b = ewin->border->border.bottom;
* c = ewin->y;
* d = ewin->y + ewin->h - ewin->border->border.bottom; */
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->h = i;
ewin->y = j;
ewin->reqy = j;
if (ewin->h < 1)
ewin->h = 1;
hh = ewin->h - ewin->border->border.top
- ewin->border->border.bottom;
if (hh < 1)
hh = 1;
ww = ewin->client.w;
EMoveResizeWindow(disp, ewin->win_container,
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->h = i;
ewin->y = j;
ewin->reqy = j;
if (ewin->h < 1)
ewin->h = 1;
hh = ewin->h - ewin->border->border.top
- ewin->border->border.bottom;
if (hh < 1)
hh = 1;
ww = ewin->client.w;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, 0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, 0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->shaded = 2;
ewin->h = b;
ewin->y = d;
@ -2814,40 +2818,41 @@ UnShadeEwin(EWin * ewin)
ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win);
EMapWindow(disp, ewin->win_container);
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->w = i;
EMoveResizeWindow(disp, ewin->win_container,
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->w = i;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
ewin->w - ewin->border->border.left -
ewin->border->border.right,
ewin->client.h);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
-(ewin->client.w -
(ewin->w - ewin->border->border.left -
ewin->border->border.right)),
0,
ewin->w - ewin->border->border.left -
ewin->border->border.right,
ewin->client.h);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
-(ewin->client.w -
(ewin->w - ewin->border->border.left -
ewin->border->border.right)),
0,
ewin->client.win, ShapeBounding, ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->w = b;
queue_up = 1;
MoveResizeEwin(ewin, ewin->x, ewin->y,
@ -2873,41 +2878,42 @@ UnShadeEwin(EWin * ewin)
ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win);
EMapWindow(disp, ewin->win_container);
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->w = i;
ewin->x = j;
ewin->reqx = j;
EMoveResizeWindow(disp, ewin->win_container,
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->w = i;
ewin->x = j;
ewin->reqx = j;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
ewin->w - ewin->border->border.left -
ewin->border->border.right,
ewin->client.h);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0,
0,
ewin->w - ewin->border->border.left -
ewin->border->border.right,
ewin->client.h);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0,
0,
ewin->client.win, ShapeBounding, ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->w = b;
ewin->x = d;
ewin->reqx = d;
@ -2931,40 +2937,41 @@ UnShadeEwin(EWin * ewin)
ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win);
EMapWindow(disp, ewin->win_container);
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->h = i;
EMoveResizeWindow(disp, ewin->win_container,
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->h = i;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
ewin->client.w,
ewin->h - ewin->border->border.top -
ewin->border->border.bottom);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0,
-(ewin->client.h -
(ewin->h - ewin->border->border.top -
ewin->border->border.bottom)),
ewin->client.w,
ewin->h - ewin->border->border.top -
ewin->border->border.bottom);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0,
-(ewin->client.h -
(ewin->h - ewin->border->border.top -
ewin->border->border.bottom)),
ewin->client.win, ShapeBounding, ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->h = b;
queue_up = 1;
MoveResizeEwin(ewin, ewin->x, ewin->y,
@ -2990,43 +2997,44 @@ UnShadeEwin(EWin * ewin)
ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win);
EMapWindow(disp, ewin->win_container);
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->h = i;
ewin->y = j;
ewin->reqy = j;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left,
ewin->border->border.top,
ewin->client.w,
ewin->h - ewin->border->border.top -
ewin->border->border.bottom);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0,
0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
if (mode.animate_shading || ewin->menu)
for (k = 0; k <= 1024; k += spd)
{
gettimeofday(&timev1, NULL);
i = ((a * (1024 - k)) + (b * k)) >> 10;
j = ((c * (1024 - k)) + (d * k)) >> 10;
ewin->h = i;
ewin->y = j;
ewin->reqy = j;
EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left,
ewin->border->border.top,
ewin->client.w,
ewin->h - ewin->border->border.top -
ewin->border->border.bottom);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y,
ewin->w, ewin->h);
CalcEwinSizes(ewin);
if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0,
0,
ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec;
dusec = timev2.tv_usec - timev1.tv_usec;
if (dusec < 0)
{
dsec--;
dusec += 1000000;
}
tm = (double)dsec + (((double)dusec) / 1000000);
spd = (int)((double)speed * tm);
if (spd < min)
spd = min;
}
ewin->h = b;
ewin->y = d;
ewin->reqy = d;

View File

@ -85,6 +85,8 @@
#define CONTROL_SHOW_PAGERS 347
#define CONTROL_PAGER_HIQ 348
#define CONTROL_PAGER_SNAP 349
#define CONTROL_ANIMATESHADING 350
#define CONTROL_MENUONSCREEN 351
#define CONTROL_USER_BG 1350
#define CONTROL_PAGER_ZOOM 1351
#define CONTROL_PAGER_TITLE 1352

View File

@ -565,6 +565,12 @@ Config_Control(FILE * ConfigFile)
case CONTROL_SHADESPEED:
mode.shadespeed = i2;
break;
case CONTROL_ANIMATESHADING:
mode.animate_shading = i2;
break;
case CONTROL_MENUONSCREEN:
mode.menusonscreen = i2;
break;
case DESKTOP_HIQUALITYBG:
desks.hiqualitybg = i2;
break;
@ -3597,6 +3603,8 @@ SaveUserControlConfig(FILE * autosavefile)
fprintf(autosavefile, "347 %i\n", (int)mode.show_pagers);
fprintf(autosavefile, "348 %i\n", (int)mode.pager_hiq);
fprintf(autosavefile, "349 %i\n", (int)mode.pager_snap);
fprintf(autosavefile, "350 %i\n", (int)mode.animate_shading);
fprintf(autosavefile, "351 %i\n", (int)mode.menusonscreen);
fprintf(autosavefile, "1350 %i\n", (int)mode.user_bg);
fprintf(autosavefile, "1351 %i\n", (int)mode.pager_zoom);
fprintf(autosavefile, "1352 %i\n", (int)mode.pager_title);

View File

@ -1349,6 +1349,7 @@ HandleUnmap(XEvent * ev)
}
else
HideEwin(ewin);
RemoveEwinFromGroup(ewin);
}
EDBUG_RETURN_;
}

View File

@ -205,38 +205,6 @@ FindEwinByMenu(Menu * m)
EDBUG_RETURN(NULL);
}
EWin **
ListWinGroupMembers(Group * g, int *num)
{
EWin **ewins, **lst = NULL;
int i, j, n;
if (!g)
{
*num = 0;
EDBUG_RETURN(NULL);
}
ewins = (EWin **) ListItemType(&n, LIST_TYPE_EWIN);
j = 0;
for (i = 0; i < n; i++)
{
if (ewins[i]->group)
{
if (g->index == ewins[i]->group->index)
{
j++;
lst = Erealloc(lst, sizeof(EWin *) * j);
lst[j - 1] = ewins[i];
}
}
}
if (ewins)
Efree(ewins);
*num = j;
EDBUG_RETURN(lst);
}
EWin **
ListWinGroupMembersForEwin(EWin * ewin, int action, int *num)
{
@ -293,12 +261,14 @@ ListWinGroupMembersForEwin(EWin * ewin, int action, int *num)
gwins = Emalloc(sizeof(EWin *));
gwins[0] = ewin;
*num = 1;
EDBUG_RETURN(gwins);
}
else
{
EDBUG_RETURN(ListWinGroupMembers(ewin->group, num));
gwins = Emalloc(sizeof(EWin *) * ewin->group->num_members);
memcpy(gwins, ewin->group->members, sizeof(EWin *) * ewin->group->num_members);
*num = ewin->group->num_members;
}
EDBUG_RETURN(gwins);
}
else
EDBUG_RETURN(NULL);

View File

@ -42,4 +42,3 @@ int numlock_mask = 0;
int scrollock_mask = 0;
int mask_mod_combos[8];
Group *current_group;
Group *pager_group = NULL;

View File

@ -3,14 +3,15 @@
Group *
CreateGroup()
{
static int index = 0;
Group *g;
struct timeval timev;
g = Emalloc(sizeof(Group));
if (!g)
EDBUG_RETURN(NULL);
g->index = index++;
/* randomizing this makes snapshotting groups a good deal easier */
g->index = rand();
g->iconify = 1;
g->kill = 0;
g->move = 1;
@ -18,28 +19,43 @@ CreateGroup()
g->set_border = 1;
g->stick = 1;
g->shade = 1;
g->ref_count = 0;
g->num_members = 0;
g->members = NULL;
EDBUG_RETURN(g);
}
void
FreeGroup(Group * g)
{
if (g)
{
if (g->members)
Efree(g->members);
Efree(g);
}
}
void
BreakWindowGroup(EWin * ewin)
{
int i, num;
EWin **gwins;
int i;
Group *g;
if (ewin)
{
gwins = ListWinGroupMembers(ewin->group, &num);
if (gwins)
if (ewin->group)
{
for (i = 0; i < num; i++)
RemoveEwinFromGroup(gwins[i]);
g = ewin->group;
Efree(gwins);
if (ewin->group->members)
{
for (i = 0; i < g->num_members; i++)
g->members[i]->group = NULL;
}
RemoveItem((char *)g, 0, LIST_FINDBY_POINTER, LIST_TYPE_GROUP);
FreeGroup(g);
}
}
}
@ -52,12 +68,16 @@ BuildWindowGroup(EWin ** ewins, int num)
Group *g;
g = CreateGroup();
AddItem(g, NULL, g->index, LIST_TYPE_GROUP);
current_group = g;
g->members = Emalloc(sizeof(EWin *) * num);
g->num_members = num;
for (i = 0; i < num; i++)
{
RemoveEwinFromGroup(ewins[i]);
g->ref_count++;
g->members[i] = ewins[i];
ewins[i]->group = g;
}
}
@ -69,20 +89,187 @@ AddEwinToGroup(EWin * ewin, Group * g)
{
RemoveEwinFromGroup(ewin);
ewin->group = g;
ewin->group->ref_count++;
g->num_members++;
g->members = Erealloc(g->members, sizeof(EWin *) * g->num_members);
g->members[g->num_members - 1] = ewin;
}
}
void
RemoveEwinFromGroup(EWin * ewin)
{
int i, j;
if (ewin)
{
if (ewin->group)
{
if (--(ewin->group->ref_count) <= 0)
Efree(ewin->group);
for (i = 0; i < ewin->group->num_members; i++)
{
if (ewin->group->members[i] == ewin)
{
for (j = i; j < ewin->group->num_members - 1; j++)
ewin->group->members[j] = ewin->group->members[j + 1];
ewin->group->num_members--;
if (ewin->group->num_members > 0)
ewin->group->members = Erealloc(ewin->group->members, sizeof(EWin *) * ewin->group->num_members);
else
{
RemoveItem((char *)ewin->group, 0, LIST_FINDBY_POINTER, LIST_TYPE_GROUP);
FreeGroup(ewin->group);
}
ewin->group = NULL;
return;
}
}
}
ewin->group = NULL;
}
}
static void ChooseGroupEscape(int val, void *data);
static void
ChooseGroupEscape(int val, void *data)
{
DialogClose((Dialog *) data);
val = 0;
}
static int tmp_group_index;
static EWin *tmp_ewin;
static void ChooseGroupForEwin(int val, void *data);
static void
ChooseGroupForEwin(int val, void *data)
{
Group **groups = NULL;
int num_groups;
if (val < 2)
{
groups = (Group **) ListItemType(&num_groups, LIST_TYPE_GROUP);
if (groups)
{
if (num_groups >= tmp_group_index) /* that's paranoid */
AddEwinToGroup(tmp_ewin, groups[tmp_group_index]);
Efree(groups);
}
}
data = NULL;
}
void
ChooseGroupForEwinDialog(EWin * ewin)
{
Dialog *d;
DItem *table, *di, *radio;
Group **groups = NULL;
int num_groups, i, j;
char **group_member_strings;
if (!ewin)
return;
tmp_ewin = ewin;
groups = (Group **) ListItemType(&num_groups, LIST_TYPE_GROUP);
if (!groups)
{
DIALOG_OK("Window Group Error", "\n Currently, no groups exist. You have to start a group first. \n");
/* FIXME... so we could start a group here by default...? */
EDBUG_RETURN_;
}
group_member_strings = Emalloc(sizeof(char *) * num_groups);
for (i = 0; i < num_groups; i++)
{
group_member_strings[i] = Emalloc(sizeof(char) * 1024);
group_member_strings[i][0] = 0;
for (j = 0; j < groups[i]->num_members; j++)
{
strcat(group_member_strings[i], groups[i]->members[j]->client.title);
strcat(group_member_strings[i], "\n");
}
}
if ((d = FindItem("GROUP_SELECTION", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
{
AUDIO_PLAY("GROUP_SETTINGS_ACTIVE");
ShowDialog(d);
return;
}
AUDIO_PLAY("SOUND_SETTINGS_GROUP");
d = CreateDialog("GROUP_SELECTION");
DialogSetTitle(d, "Window Group Selection");
table = DialogInitItem(d);
DialogItemTableSetOptions(table, 2, 0, 0, 0);
di = DialogAddItem(table, DITEM_IMAGE);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemImageSetFile(di, "pix/place.png");
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemTextSetText(di,
"Enlightenment Window Group\n"
"Selection Dialog\n");
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0);
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 0, 512);
DialogItemTextSetText(di, " Pick the group the window will belong to: \n");
radio = di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetColSpan(di, 2);
DialogItemRadioButtonSetText(di, group_member_strings[0]);
DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, 0);
for (i = 1; i < num_groups; i++)
{
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemRadioButtonSetText(di, group_member_strings[i]);
DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, i);
}
DialogItemRadioButtonGroupSetValPtr(radio, &tmp_group_index);
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0);
DialogAddButton(d, "OK", ChooseGroupForEwin, 1);
DialogAddButton(d, "Apply", ChooseGroupForEwin, 0);
DialogAddButton(d, "Close", ChooseGroupForEwin, 1);
DialogSetExitFunction(d, ChooseGroupForEwin, 2, d);
DialogBindKey(d, "Escape", ChooseGroupEscape, 0, d);
DialogBindKey(d, "Return", ChooseGroupForEwin, 0, d);
for (i = 0; i < num_groups; i++)
Efree(group_member_strings[i]);
Efree(groups);
Efree(group_member_strings);
ShowDialog(d);
}

View File

@ -2020,7 +2020,7 @@ IconboxHandleEvent(XEvent * ev)
else if ((ev->type == ButtonRelease) && (ib[i]->scrollbox_clicked))
{
int x, y, w, h;
ib[i]->scrollbox_clicked = 0;
GetWinXY(ib[i]->scrollbar_win, &x, &y);
GetWinWH(ib[i]->scrollbar_win, &w, &h);
@ -2033,7 +2033,7 @@ IconboxHandleEvent(XEvent * ev)
if (ev->xany.window == ib[i]->scrollbar_win)
{
static int px, py;
if (ev->type == ButtonPress)
{
if (ev->xbutton.button == 1)
@ -2055,12 +2055,12 @@ IconboxHandleEvent(XEvent * ev)
{
int dx, dy, bs, x, y;
ImageClass *ic;
dx = ev->xmotion.x_root - px;
dy = ev->xmotion.y_root - py;
px = ev->xmotion.x_root;
py = ev->xmotion.y_root;
if (ib[i]->orientation)
{
ic = FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
@ -2151,15 +2151,15 @@ IconboxHandleEvent(XEvent * ev)
EWin **gwins;
int j, num;
char iconified;
ib[i]->icon_clicked = 0;
ewin = IB_FindIcon(ib[i], ev->xbutton.x, ev->xbutton.y);
if (ewin)
{
gwins = ListWinGroupMembersForEwin(ewin, ACTION_ICONIFY, &num);
iconified = ewin->iconified;
if (gwins)
{
for (j = 0; j < num; j++)

View File

@ -305,6 +305,7 @@ IPCStruct IPCArray[] =
"raindrops <on/off> (raindrops will appear across your desktop)\n"
"menu_animate <on/off> (toggles the animation of menus "
"as they appear)\n"
"animate_win_shading <on/off> (toggles the animation of window shading)\n"
"window_shade_speed <#> (number of pixels/sec to shade a window)\n"
"dragbar <on/off/left/right/top/bottom> (changes "
"location of dragbar)\n"
@ -2694,12 +2695,36 @@ IPC_FX(char *params, Client * c)
"Error: unknown mode specified\n");
}
}
else if (!strcmp(word1, "animate_win_shading"))
{
word(params, 2, word2);
if (!strcmp(word2, "on"))
{
mode.animate_shading = 1;
}
else if (!strcmp(word2, "off"))
{
mode.animate_shading = 0;
}
else if (!strcmp(word2, "?"))
{
if (mode.animate_shading)
Esnprintf(buf, sizeof(buf), "animate_win_shading: on\n");
else
Esnprintf(buf, sizeof(buf), "animate_win_shading: off\n");
}
else
{
Esnprintf(buf, sizeof(buf),
"Error: unknown mode specified\n");
}
}
else if (!strcmp(word1, "window_shade_speed"))
{
word(params, 2, word2);
if (!strcmp(word2, "?"))
{
if (mode.shadespeed)
if (mode.animate_shading)
{
Esnprintf(buf, sizeof(buf), "shadespeed: %d seconds\n",
mode.shadespeed);

View File

@ -280,7 +280,7 @@ void
ShowMenu(Menu * m, char noshow)
{
EWin *ewin;
int x, y, wx, wy; /* wx, wy added to stop menus from appearing offscreen */
int x, y, wx, wy; /* wx, wy added to stop menus from appearing offscreen */
unsigned int w, h, mw, mh;
EDBUG(5, "ShowMenu");
@ -300,42 +300,55 @@ ShowMenu(Menu * m, char noshow)
GetWinWH(m->items[0]->win, &w, &h);
GetWinWH(m->win, &mw, &mh);
if (mode.x - x -(w / 2) > root.w)
{
wx = 0 + (mw - w);
}
else if (mode.x + w > root.w)
{
wx = root.w - mw - (mw - w);
}
else
{
wx = mode.x - x -(w / 2);
}
if (mode.y + mh > root.h)
{
wy = root.h - mh;
}
else
{
wy = mode.y - y - (h / 2);
}
if (mode.menusonscreen)
{
if (mode.x - x - (w / 2) > root.w)
{
wx = 0 + (mw - w);
}
else if (mode.x + w > root.w)
{
wx = root.w - mw - (mw - w);
}
else
{
wx = mode.x - x - (w / 2);
}
if ((mode.x >= 0) && (mode.y >= 0))
EMoveWindow(disp, m->win, wx, wy);
if (mode.y + mh > root.h)
{
wy = root.h - mh;
}
else
{
wy = mode.y - y - (h / 2);
}
}
if ((mode.x >= 0) && (mode.y >= 0))
{
if (mode.menusonscreen)
EMoveWindow(disp, m->win, wx, wy);
else
EMoveWindow(disp, m->win, mode.x - x - (w / 2), mode.y - y - (h / 2));
}
else if ((mode.x >= 0) && (mode.y < 0))
{
if (((-mode.y) + (int)mh) > (int)root.h)
mode.y = -((-mode.y) - mode.context_h - mh);
EMoveWindow(disp, m->win, wx, -mode.y);
if (mode.menusonscreen)
EMoveWindow(disp, m->win, wx, -mode.y);
else
EMoveWindow(disp, m->win, mode.x - x - (w / 2), -mode.y);
}
else if ((mode.x < 0) && (mode.y >= 0))
{
if (((-mode.x) + (int)mw) > (int)root.w)
mode.x = -((-mode.x) - mode.context_w - mw);
EMoveWindow(disp, m->win, -mode.x, wy);
if (mode.menusonscreen)
EMoveWindow(disp, m->win, -mode.x, wy);
else
EMoveWindow(disp, m->win, -mode.x, mode.y - y - (h / 2));
}
else
{

View File

@ -603,13 +603,15 @@ PagerShow(Pager * p)
ewin->client.height.max = 240 * ay;
ewin->pager = p;
ewin->desktop = desks.current;
if (!pager_group)
{
BuildWindowGroup(&ewin, 1);
pager_group = ewin->group;
}
else
AddEwinToGroup(ewin, pager_group);
/*
* if (!pager_group)
* {
* BuildWindowGroup(&ewin, 1);
* pager_group = ewin->group;
* }
* else
* AddEwinToGroup(ewin, pager_group);
*/
p->ewin = ewin;
p->visible = 1;
DesktopRemoveEwin(ewin);

View File

@ -1343,10 +1343,11 @@ SettingsAudio(void)
static char tmp_saveunders;
static char tmp_animated_menus;
static char tmp_menusonscreen;
static char tmp_map_slide;
static char tmp_cleanup_slide;
static char tmp_desktop_slide;
static char tmp_shade;
static char tmp_animate_shading;
static char tmp_dragbar;
static int tmp_dragdir;
static int tmp_slide_mode;
@ -1363,13 +1364,12 @@ CB_ConfigureFX(int val, void *data)
{
mode.save_under = tmp_saveunders;
mode.menuslide = tmp_animated_menus;
mode.menusonscreen = tmp_menusonscreen;
mode.mapslide = tmp_map_slide;
mode.cleanupslide = tmp_cleanup_slide;
desks.slidein = tmp_desktop_slide;
if (tmp_shade)
mode.shadespeed = tmp_shade_speed;
else
mode.shadespeed = 90000;
mode.animate_shading = tmp_animate_shading;
mode.shadespeed = tmp_shade_speed;
mode.slidemode = tmp_slide_mode;
mode.slidespeedmap = tmp_map_slide_speed;
mode.slidespeedcleanup = tmp_cleanup_slide_speed;
@ -1413,21 +1413,19 @@ SettingsSpecialFX(void)
tmp_saveunders = mode.save_under;
tmp_animated_menus = mode.menuslide;
tmp_menusonscreen = mode.menusonscreen;
tmp_map_slide = mode.mapslide;
tmp_cleanup_slide = mode.cleanupslide;
tmp_desktop_slide = desks.slidein;
if (mode.shadespeed > 20000)
tmp_shade = 0;
else
tmp_shade = 1;
tmp_animate_shading = mode.animate_shading;
if (desks.dragbar_width < 1)
tmp_dragbar = 0;
else
tmp_dragbar = 1;
tmp_dragdir = desks.dragdir;
tmp_slide_mode = mode.slidemode;
tmp_shade_speed = mode.shadespeed;
tmp_map_slide_speed = mode.slidespeedmap;
tmp_shade_speed = mode.shadespeed;
tmp_cleanup_slide_speed = mode.slidespeedcleanup;
tmp_desktop_slide_speed = desks.slidespeed;
@ -1533,9 +1531,9 @@ SettingsSpecialFX(void)
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetColSpan(di, 3);
DialogItemCheckButtonSetText(di, "Use saveunders to reduce window exposures");
DialogItemCheckButtonSetState(di, tmp_saveunders);
DialogItemCheckButtonSetPtr(di, &tmp_saveunders);
DialogItemCheckButtonSetText(di, "Always popup menus onscreen");
DialogItemCheckButtonSetState(di, tmp_menusonscreen);
DialogItemCheckButtonSetPtr(di, &tmp_menusonscreen);
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetPadding(di, 2, 2, 2, 2);
@ -1545,13 +1543,21 @@ SettingsSpecialFX(void)
DialogItemRadioButtonGroupSetVal(di, 4);
DialogItemRadioButtonGroupSetValPtr(radio, &tmp_slide_mode);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetColSpan(di, 4);
DialogItemCheckButtonSetText(di, "Use saveunders to reduce window exposures");
DialogItemCheckButtonSetState(di, tmp_saveunders);
DialogItemCheckButtonSetPtr(di, &tmp_saveunders);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetColSpan(di, 4);
DialogItemCheckButtonSetText(di, "Animate shading and unshading of windows");
DialogItemCheckButtonSetState(di, tmp_shade);
DialogItemCheckButtonSetPtr(di, &tmp_shade);
DialogItemCheckButtonSetState(di, tmp_animate_shading);
DialogItemCheckButtonSetPtr(di, &tmp_animate_shading);
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 4);
@ -3388,13 +3394,9 @@ SettingsGroup(Group * g)
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 0, 512);
DialogItemTextSetText(di, " The following actions are ");
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 0, 512);
DialogItemTextSetText(di, " applied to all group members: ");
DialogItemTextSetText(di,
" The following actions are \n"
" applied to all group members: ");
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetPadding(di, 2, 2, 2, 2);

View File

@ -477,6 +477,7 @@ SetupX()
mode.slidespeedmap = 6000;
mode.slidespeedcleanup = 8000;
mode.shadespeed = 8000;
mode.animate_shading = 1;
mode.doingslide = 0;
mode.server_grabbed = 0;
mode.desktop_bg_timeout = 240;
@ -497,6 +498,7 @@ SetupX()
for (i = 0; i < 256; i++)
mode.cur_menu[i] = NULL;
mode.menuslide = 0;
mode.menusonscreen = 1;
mode.numdesktops = 2;
mode.transientsfollowleader = 1;
mode.switchfortransientmap = 1;

View File

@ -72,6 +72,7 @@ GetSnapshot(EWin * ewin)
sn->shade = 0;
sn->use_cmd = 0;
sn->cmd = NULL;
sn->group = 0;
sn->apply_to_all = 0;
sn->used = 1;
ewin->snap = sn;
@ -109,12 +110,21 @@ NewSnapshot(char *name)
sn->shade = 0;
sn->use_cmd = 0;
sn->cmd = NULL;
sn->group = 0;
sn->apply_to_all = 0;
sn->used = 0;
AddItemEnd(sn, sn->name, 0, LIST_TYPE_SNAPSHOT);
return sn;
}
static void CB_ApplySnapEscape(int val, void *data);
static void
CB_ApplySnapEscape(int val, void *data)
{
DialogClose((Dialog *) data);
val = 0;
}
static Window tmp_snap_client;
static char tmp_snap_border;
static char tmp_snap_desktop;
@ -126,6 +136,7 @@ static char tmp_snap_icon;
static char tmp_snap_shade;
static char tmp_snap_cmd;
static char tmp_snap_all_instances;
static char tmp_snap_group;
static void CB_ApplySnap(int val, void *data);
static void
@ -158,6 +169,7 @@ CB_ApplySnap(int val, void *data)
SnapshotEwinShade(ewin);
if (tmp_snap_cmd)
SnapshotEwinCmd(ewin);
SnapshotEwinGroup(ewin, tmp_snap_group);
SnapshotEwinAllInstances(ewin, tmp_snap_all_instances);
if ((!tmp_snap_border) &&
(!tmp_snap_desktop) &&
@ -167,7 +179,8 @@ CB_ApplySnap(int val, void *data)
(!tmp_snap_sticky) &&
(!tmp_snap_icon) &&
(!tmp_snap_shade) &&
(!tmp_snap_cmd))
(!tmp_snap_cmd) &&
(!tmp_snap_group))
UnsnapshotEwin(ewin);
SaveSnapInfo();
}
@ -192,13 +205,15 @@ SnapshotEwinDialog(EWin * ewin)
DialogSetTitle(d, "Application attributes");
table = DialogInitItem(d);
DialogItemTableSetOptions(table, 2, 0, 0, 0);
DialogItemTableSetOptions(table, 4, 0, 0, 0);
di = DialogAddItem(table, DITEM_IMAGE);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetColSpan(di, 2);
DialogItemImageSetFile(di, "pix/snapshots.png");
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemTextSetText(di,
@ -217,6 +232,7 @@ SnapshotEwinDialog(EWin * ewin)
tmp_snap_icon = 0;
tmp_snap_shade = 0;
tmp_snap_cmd = 0;
tmp_snap_group = 0;
tmp_snap_all_instances = 0;
if (sn)
{
@ -238,64 +254,109 @@ SnapshotEwinDialog(EWin * ewin)
tmp_snap_shade = 1;
if (sn->use_cmd)
tmp_snap_cmd = 1;
if (sn->group)
tmp_snap_group = 1;
if (sn->apply_to_all)
tmp_snap_all_instances = 1;
}
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
DialogItemSetColSpan(di, 4);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0);
Esnprintf(s, sizeof(s), "Title: %80s", ewin->client.title);
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetColSpan(di, 2);
DialogItemSetFill(di, 0, 0);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 0, 512);
DialogItemTextSetText(di, s);
DialogItemTextSetText(di, "Title:");
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 3);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 1024, 512);
DialogItemTextSetText(di, ewin->client.title);
if (ewin->client.name)
{
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 0, 0);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 0, 512);
DialogItemTextSetText(di, "Name:");
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 3);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 1024, 512);
DialogItemTextSetText(di, ewin->client.name);
}
else
di = DialogAddItem(table, DITEM_NONE);
if (ewin->client.class)
{
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 0, 0);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 0, 512);
DialogItemTextSetText(di, "Class:");
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 3);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 1024, 512);
DialogItemTextSetText(di, ewin->client.class);
}
else
di = DialogAddItem(table, DITEM_NONE);
if (ewin->client.command)
{
Esnprintf(s, sizeof(s), "Command: %s", ewin->client.command);
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetColSpan(di, 2);
DialogItemSetFill(di, 0, 0);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 0, 512);
DialogItemTextSetText(di, s);
DialogItemTextSetText(di, "Command:");
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 3);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetAlign(di, 1024, 512);
/* if the command is long, cut in into slices of about 80 characters */
if (strlen(ewin->client.command) > 80)
{
int i = 0, slice, last;
s[0] = 0;
slice = 80;
while (i <= strlen(ewin->client.command))
{
last = i;
i += 80;
slice = 80;
/* and make sure that we don't cut in the middle of a word. */
while (ewin->client.command[i++] != ' ')
slice++;
strncat(s, ewin->client.command + last, slice);
strcat(s, "\n");
}
DialogItemTextSetText(di, s);
}
else
DialogItemTextSetText(di, ewin->client.command);
}
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
DialogItemSetColSpan(di, 4);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Location");
@ -303,6 +364,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemCheckButtonSetPtr(di, &tmp_snap_location);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Border style");
@ -310,6 +372,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemCheckButtonSetPtr(di, &tmp_snap_border);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Size");
@ -317,6 +380,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemCheckButtonSetPtr(di, &tmp_snap_size);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Desktop");
@ -324,6 +388,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemCheckButtonSetPtr(di, &tmp_snap_desktop);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Shaded state");
@ -331,6 +396,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemCheckButtonSetPtr(di, &tmp_snap_shade);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Sticky state");
@ -338,6 +404,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemCheckButtonSetPtr(di, &tmp_snap_sticky);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Stacking layer");
@ -347,6 +414,7 @@ SnapshotEwinDialog(EWin * ewin)
if (ewin->client.command)
{
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Restart application on login");
@ -354,10 +422,24 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemCheckButtonSetPtr(di, &tmp_snap_cmd);
}
else
di = DialogAddItem(table, DITEM_NONE);
{
di = DialogAddItem(table, DITEM_NONE);
DialogItemSetColSpan(di, 2);
}
if (ewin->group)
{
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 4);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Remember entire group");
DialogItemCheckButtonSetState(di, tmp_snap_group);
DialogItemCheckButtonSetPtr(di, &tmp_snap_group);
}
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
DialogItemSetColSpan(di, 4);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0);
@ -365,13 +447,13 @@ SnapshotEwinDialog(EWin * ewin)
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSetColSpan(di, 2);
DialogItemSetColSpan(di, 4);
DialogItemCheckButtonSetText(di, "Applies to all instances of this window");
DialogItemCheckButtonSetState(di, tmp_snap_all_instances);
DialogItemCheckButtonSetPtr(di, &tmp_snap_all_instances);
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
DialogItemSetColSpan(di, 4);
DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0);
@ -379,7 +461,10 @@ SnapshotEwinDialog(EWin * ewin)
DialogAddButton(d, "OK", CB_ApplySnap, 1);
DialogAddButton(d, "Apply", CB_ApplySnap, 0);
DialogAddButton(d, "Cancel", CB_ApplySnap, 1);
DialogSetExitFunction(d, CB_ApplySnap, 1, d);
DialogSetExitFunction(d, CB_ApplySnap, 2, d);
DialogBindKey(d, "Escape", CB_ApplySnapEscape, 0, d);
DialogBindKey(d, "Return", CB_ApplySnap, 0, d);
ShowDialog(d);
}
/* record info about this Ewin's attributes */
@ -509,6 +594,52 @@ SnapshotEwinCmd(EWin * ewin)
sn->cmd = duplicate(ewin->client.command);
}
void
SnapshotEwinGroup(EWin * ewin, char onoff)
{
Snapshot *sn;
EWin **gwins = NULL;
int i, num;
if (!ewin->group)
return;
gwins = ListWinGroupMembersForEwin(ewin, ACTION_NONE, &num);
for (i = 0; i < num; i++)
{
if (onoff)
{
if (gwins[i]->snap)
UnsnapshotEwin(gwins[i]);
sn = GetSnapshot(gwins[i]);
if (sn)
{
sn->group = gwins[i]->group->index;
SnapshotEwinBorder(gwins[i]);
SnapshotEwinDesktop(gwins[i]);
SnapshotEwinSize(gwins[i]);
SnapshotEwinLocation(gwins[i]);
SnapshotEwinLayer(gwins[i]);
SnapshotEwinSticky(gwins[i]);
SnapshotEwinIcon(gwins[i]);
SnapshotEwinShade(gwins[i]);
SnapshotEwinCmd(gwins[i]);
}
}
else
{
sn = GetSnapshot(gwins[i]);
if (sn)
{
sn->group = 0;
}
}
}
Efree(gwins);
}
void
SnapshotEwinAllInstances(EWin * ewin, char onoff)
{
@ -542,6 +673,7 @@ SnapshotEwinAll(EWin * ewin)
SnapshotEwinIcon(ewin);
SnapshotEwinShade(ewin);
SnapshotEwinCmd(ewin);
SnapshotEwinGroup(ewin, 1);
}
/* unsnapshot any saved info about this ewin */
@ -645,6 +777,8 @@ SaveSnapInfo(void)
fprintf(f, "ICON: %s\n", sn->iclass_name);
if (sn->cmd)
fprintf(f, "CMD: %s\n", sn->cmd);
if (sn->group)
fprintf(f, "GROUP: %i\n", sn->group);
}
Efree(lst);
}
@ -770,6 +904,11 @@ LoadSnapInfo(void)
sn->border_name = duplicate(atword(buf, 2));
else if (!strcmp(s, "ICON:"))
sn->iclass_name = duplicate(atword(buf, 2));
else if (!strcmp(s, "GROUP:"))
{
word(buf, 2, s);
sn->group = atoi(s);
}
}
}
fclose(f);
@ -844,6 +983,19 @@ MatchEwinToSnapInfo(EWin * ewin)
SetEwinToBorder(ewin, b);
}
}
if (sn->group)
{
Group *g = (Group *) FindItem(NULL, sn->group, LIST_FINDBY_ID, LIST_TYPE_GROUP);
if (!g)
{
BuildWindowGroup(&ewin, 1);
ewin->group->index = sn->group;
ListChangeItemID(LIST_TYPE_GROUP, ewin->group, sn->group);
}
else
AddEwinToGroup(ewin, g);
}
}
void
@ -896,7 +1048,7 @@ MatchEwinToSnapInfoAfter(EWin * ewin)
if (sn->sticky)
MakeWindowSticky(ewin);
else
MakeWindowSticky(ewin);
MakeWindowUnSticky(ewin);
}
if (sn->use_shade)
{

View File

@ -44,8 +44,10 @@ __CONTROL __BGN
__DOCK_DIRECTION __UP
__START_POSITION_OF_DOCK 0 0
__SHADING_SPEED 8000
__ANIMATE_WINDOW_SHADING __ON
__BE_PARANOID_ABOUT_SAVING_MEMORY __ON
__MENUS_SLIDE_OUT __OFF
__MENUS_ONSCREEN __ON
__NUMBER_OF_DESKTOPS 4
__AUTOMATICALLY_SAVE_CONFIG __ON
__DESKTOP_AREA_SIZE 2 2

View File

@ -127,6 +127,8 @@
#define __SHOW_PAGERS 347
#define __PAGER_DISPLAY_HIQ 348
#define __PAGER_DISPLAY_SNAPSHOTS 349
#define __ANIMATE_WINDOW_SHADING 350
#define __MENUS_ONSCREEN 351
#define __PREFER_USER_BACKGROUNDS 1350
#define __ZOOM_PAGER_WINDOWS 1351
#define __SHOW_PAGER_WINDOW_TITLE 1352

View File

@ -138,7 +138,8 @@ END_MENU
BEGIN_NEW_MENU("WINOPS_GROUP", "EMPTY")
ADD_MENU_TEXT_ITEM("Configure group", __A_CONFIG, "group")
ADD_MENU_TEXT_ITEM("Start group", __A_START_GROUP,"")
ADD_MENU_TEXT_ITEM("Add to group", __A_ADD_TO_GROUP,"")
ADD_MENU_TEXT_ITEM("Select group to add to", __A_CONFIG, "group_membership")
ADD_MENU_TEXT_ITEM("Add to current group", __A_ADD_TO_GROUP,"")
ADD_MENU_TEXT_ITEM("Remove from group", __A_REMOVE_FROM_GROUP,"")
ADD_MENU_TEXT_ITEM("Break group", __A_BREAK_GROUP, "")
ADD_MENU_TEXT_ITEM("Show/Hide Group", __A_SHOWHIDE_GROUP, "")

View File

@ -12,6 +12,6 @@ epix_DATA = wait1.png wait2.png wait3.png wait4.png \
areas.png bg.png key_ctrl.png key_lock.png key_mod1.png \
key_mod2.png key_mod3.png key_mod4.png key_mod5.png \
key_shift.png mouse_0.png mouse_1.png mouse_2.png \
mouse_3.png mouse_any.png key_blank.png
mouse_3.png mouse_any.png key_blank.png snapshots.png
EXTRA_DIST = $(epix_DATA)

Binary file not shown.