diff --git a/src/ChangeLog b/src/ChangeLog index f75c8dda..694faa8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2332,3 +2332,14 @@ Fri Sep 24 10:58:11 PDT 1999 (Raster) fix slideout segfault bug problem thingy majigo + +------------------------------------------------------------------------------- + +Fri Sep 24 12:30:53 PDT 1999 +(KainX) + +If there is no iconbox and the user tries to iconify something, create +a default iconbox. This code does the exact same thing as selecting +"Create New Iconbox" from the menu (except that it's automatic), so it +should be safe. But feel free to remove it anyway if you don't think +it's ready for 0.16. It's just the behavior I think users expect. :-) diff --git a/src/actions.c b/src/actions.c index 8a005a09..d6e6504c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -3365,7 +3365,7 @@ doInsertKeys(void *params) int doCreateIconbox(void *params) { - EDBUG(6, "doSetPagerSnap"); + EDBUG(6, "doCreateIconbox"); if (InZoom()) EDBUG_RETURN(0); if (params) diff --git a/src/iconify.c b/src/iconify.c index 4cee7d1f..b079910a 100644 --- a/src/iconify.c +++ b/src/iconify.c @@ -974,6 +974,18 @@ SelectIconboxForEwin(EWin * ewin) } Efree(ib); } + else + { + /* If there are no iconboxes, create one. */ + doCreateIconbox(NULL); + ib = ListAllIconboxes(&num); + if (ib) /* paranoia */ + { + ib_sel = ib[0]; + Efree(ib); + } + } + return ib_sel; } diff --git a/src/ipc.c b/src/ipc.c index 324a3645..44104e8b 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1495,9 +1495,9 @@ IPC_ImageClass(char *params, Client * c) { st = STATE_NORMAL; } - if ((hptr = atword(winptr, 3))) + if ((hptr = atword(params, 6))) { - w = (int)strtol(atword(winptr, 2), (char **)NULL, 0); + w = (int)strtol(atword(params, 5), (char **)NULL, 0); h = (int)strtol(hptr, (char **)NULL, 0); } IclassApply(iclass, win, w, h, 0, 0, st, 0); @@ -1535,13 +1535,13 @@ IPC_ImageClass(char *params, Client * c) { st = STATE_NORMAL; } - if (!(hptr = atword(winptr, 3))) + if (!(hptr = atword(params, 6))) { Esnprintf(buf, sizeof(buf), "Error: missing width and/or height\n"); } else { - w = (int)strtol(atword(winptr, 2), (char **)NULL, 0); + w = (int)strtol(atword(params, 5), (char **)NULL, 0); h = (int)strtol(hptr, (char **)NULL, 0); IclassApplyCopy(iclass, win, w, h, 0, 0, st, &pmap, &mask); Esnprintf(buf, sizeof(buf), "0x%08x 0x%08x\n", pmap, mask);