summaryrefslogtreecommitdiff
path: root/src/iconmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iconmgr.c')
-rw-r--r--src/iconmgr.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/iconmgr.c b/src/iconmgr.c
index e59f849..dcf0881 100644
--- a/src/iconmgr.c
+++ b/src/iconmgr.c
@@ -57,7 +57,6 @@ void
CreateIconManagers(void)
{
IconMgr *p;
- int mask;
char str[100];
char str1[100];
Pixel background;
@@ -74,9 +73,9 @@ CreateIconManagers(void)
}
for (p = &Scr->iconmgr; p != NULL; p = p->next) {
- mask = XParseGeometry(p->geometry, &JunkX, &JunkY,
- (unsigned int *) &p->width,
- (unsigned int *) &p->height);
+ int mask = XParseGeometry(p->geometry, &JunkX, &JunkY,
+ (unsigned int *) &p->width,
+ (unsigned int *) &p->height);
if (mask & XNegative)
JunkX = Scr->MyDisplayWidth - p->width -
@@ -129,7 +128,7 @@ AllocateIconManager(char *name, char *icon_name, char *geom, int columns)
#ifdef DEBUG_ICONMGR
fprintf(stderr, "AllocateIconManager\n");
fprintf(stderr, " name=\"%s\" icon_name=\"%s\", geom=\"%s\", col=%d\n",
- name, icon_name, geom, columns);
+ name, icon_name ? icon_name : "<null>", geom, columns);
#endif
if (Scr->NoIconManagers)
@@ -290,8 +289,6 @@ JumpIconManager(int dir)
{
IconMgr *ip, *tmp_ip = NULL;
int got_it = FALSE;
- ScreenInfo *sp;
- int screen;
if (!Active)
return;
@@ -309,8 +306,11 @@ JumpIconManager(int dir)
if (!got_it) {
int origscreen = ip->scr->screen;
int inc = (dir == F_NEXTICONMGR ? 1 : -1);
+ int screen;
for (screen = origscreen + inc;; screen += inc) {
+ ScreenInfo *sp;
+
if (screen >= NumScreens)
screen = 0;
else if (screen < 0)
@@ -461,8 +461,8 @@ InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win)
{
WList *tmp1;
int added;
- int (*compar) (const char *, const char *)
- = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
+ int (*compar)(const char *, const char *)
+ =(Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
added = FALSE;
if (ip->first == NULL) {
@@ -594,8 +594,8 @@ SortIconManager(IconMgr *ip)
{
WList *tmp1, *tmp2;
int done;
- int (*compar) (const char *, const char *)
- = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
+ int (*compar)(const char *, const char *)
+ =(Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
if (ip == NULL)
ip = Active->iconmgr;
@@ -629,7 +629,6 @@ void
PackIconManager(IconMgr *ip)
{
int newwidth, i, row, col, maxcol, colinc, rowinc, wheight, wwidth;
- int new_x, new_y;
int savewidth;
WList *tmp;
@@ -645,7 +644,10 @@ PackIconManager(IconMgr *ip)
row = 0;
col = ip->columns;
maxcol = 0;
+
for (i = 0, tmp = ip->first; tmp != NULL; i++, tmp = tmp->next) {
+ int new_x, new_y;
+
tmp->me = i;
if (++col >= ip->columns) {
col = 0;