And now for something completely different…

92
The following patch will change the behavior of the window maker dock to that of the clip allowing you to place icons in any arbitrary order.

(click the read more button for the patch)


Author: Mike Baker

--- wmaker-0.61.1.orig/src/dock.c Mon Sep 27 11:58:05 1999
+++ wmaker-0.61.1/src/dock.c Tue Nov 2 18:34:12 1999
@@ -1231,10 +1231,7 @@
dock = wmalloc(sizeof(WDock));
memset(dock, 0, sizeof(WDock));

- if (type == WM_CLIP)
icon_count = CLIP_MAX_ICONS;
- else
- icon_count = scr->scr_height/wPreferences.icon_size;

dock->icon_array = wmalloc(sizeof(WAppIcon*)*icon_count);
memset(dock->icon_array, 0, sizeof(WAppIcon*)*icon_count);
@@ -1673,14 +1670,6 @@
wwarning(_("bad value in docked icon state info %s"),
PLGetString(dPosition));

- /* check position sanity */
- /* incomplete section! */
- if (type == WM_DOCK) {
- aicon->xindex = 0;
- if (aicon->yindex xindex, aicon->yindex);
- }
} else {
aicon->yindex = index;
aicon->xindex = 0;
@@ -2538,82 +2527,30 @@
return False;

if (dock->type == WM_DOCK) {
- if (icon->dock != dock && ex_x != 0)
- return False;
-
+ int neighbours = 0;
aicon = NULL;
for (i=0; imax_icons; i++) {
nicon = dock->icon_array[i];
- if (nicon && nicon->yindex == ex_y) {
+ if (nicon && nicon->xindex == ex_x && nicon->yindex == ex_y) {
aicon = nicon;
break;
}
}
-
- if (redocking) {
- int sig, done, closest;
-
- /* Possible cases when redocking:
- *
- * icon dragged out of range of any slot -> false
- * icon dragged to range of free slot
- * icon dragged to range of same slot
- * icon dragged to range of different icon
- */
- if (abs(ex_x) > DOCK_DETTACH_THRESHOLD)
- return False;
-
- if (ex_y>=0 && ex_y= 0) {
- for (j = 0; jmax_icons; j++) {
- if (dock->icon_array[j]
- && dock->icon_array[j]->yindex==closest) {
- /* slot is used by someone else */
- if (dock->icon_array[j]!=icon)
- done = 0;
+ for (i=0; imax_icons; i++) {
+ nicon = dock->icon_array[i];
+ if (nicon && nicon != icon && /* Icon can't be it's own neighbour */
+ (abs(nicon->xindex - ex_x) yindex - ex_y) = 0 && closest = closest && ex_y - closest = 0 && ex_y