diff -Naur WindowMaker-0.92.0-orig/src/appicon.c WindowMaker-0.92.0/src/appicon.c
--- WindowMaker-0.92.0-orig/src/appicon.c	2007-01-10 23:30:45.000000000 +0100
+++ WindowMaker-0.92.0/src/appicon.c	2007-01-10 23:45:02.000000000 +0100
@@ -60,6 +60,7 @@
 extern WPreferences wPreferences;
 
 #define MOD_MASK       wPreferences.modifier_mask
+#define ICON_SIZE      wPreferences.icon_size
 
 void appIconMouseDown(WObjDescriptor *desc, XEvent *event);
 static void iconDblClick(WObjDescriptor *desc, XEvent *event);
@@ -568,28 +569,12 @@
 }
 
 
-
 void
 appIconMouseDown(WObjDescriptor *desc, XEvent *event)
 {
     WAppIcon *aicon = desc->parent;
     WIcon *icon = aicon->icon;
-    XEvent ev;
-    int x=aicon->x_pos, y=aicon->y_pos;
-    int dx=event->xbutton.x, dy=event->xbutton.y;
-    int grabbed=0;
-    int done=0;
-    int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
     WScreen *scr = icon->core->screen_ptr;
-    WWorkspace *workspace = scr->workspaces[scr->current_workspace];
-    int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
-    int ix, iy;
-    int clickButton = event->xbutton.button;
-    Pixmap ghost = None;
-    Window wins[2];
-    Bool movingSingle = False;
-    int oldX = x;
-    int oldY = y;
 
     if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
         return;
@@ -624,11 +609,47 @@
         return;
     }
 
+    wHandleAppIconMove(aicon, event);
+}
+
+
+void
+wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
+{
+    /* merger of late appicon.c:appIconMouseDown and dock.c:iconMouseDown */
+    WDock   *original_dock = aicon->dock; /* can be NULL */
+    WIcon   *icon = aicon->icon;
+    WScreen *scr = icon->core->screen_ptr;
+    WDock   *last_dock = original_dock;
+    WDock   *all_docks[scr->drawer_count + 2]; /* fixme */
+    WDrawerChain *dc;
+
+    Bool done = False, dockable, ondock;
+    Bool grabbed = False, collapsed = False;
+    Bool superfluous = wPreferences.superfluous; /* we cache it to avoid problems */
+    Bool omnipresent = aicon->omnipresent;       /* this must be cached!!! */
+    Bool shown_clip_icons = False;
+
+    int      x = aicon->x_pos,         y = aicon->y_pos;
+    int   oldX = x,                 oldY = y;
+    int shad_x = x,               shad_y = y;
+    int  ofs_x = event->xbutton.x, ofs_y = event->xbutton.y;
+    int clickButton = event->xbutton.button;
+    int     ix = aicon->xindex,       iy = aicon->yindex;
+    int i, tmp = 0; /* initialized here to avoid a warning */
+
+    Window wins[2];
+    XEvent ev;
+    Pixmap ghost = None;
+
+    if (wPreferences.flags.noupdates) /* Daniel: was only in dock.c:iconMouseDown */
+	return;
+
 #ifdef DEBUG
-    puts("Moving icon");
+    puts("Moving appicon");
 #endif
     if (event->xbutton.state & MOD_MASK)
-        wLowerFrame(icon->core);
+        wLowerFrame(icon->core); /* Daniel: was only in appicon.c:appIconMouseDown */
     else
         wRaiseFrame(icon->core);
 
@@ -638,23 +659,58 @@
         wwarning("pointer grab failed for appicon move");
     }
 
-    if (wPreferences.flags.nodock && wPreferences.flags.noclip)
-        dockable = 0;
-    else
-        dockable = canBeDocked(icon->owner);
+    if (original_dock) {
+        dockable = True;
+        ondock = True;
+    } else {
+        ondock = False;
+        if (wPreferences.flags.nodock && wPreferences.flags.noclip)
+            dockable = False;
+        else
+            dockable = canBeDocked(icon->owner);
+    }
+
+    /* We try the various docks in that order:
+     * - First, the dock the appicon comes from, if any
+     * - Then, the drawers
+     * - Then, the "dock" (WM_DOCK)
+     * - Eventually, the clip
+     */
+    i = 0;
+    if (original_dock != NULL)
+        all_docks[ i++ ] = original_dock;
+    for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+        if (dc->adrawer != original_dock)
+            all_docks[ i++ ] = dc->adrawer;
+    }
+    if (!wPreferences.flags.nodock && scr->dock != original_dock) {
+        all_docks[ i++ ] = scr->dock;
+    }
+    if (!wPreferences.flags.noclip &&
+        original_dock != scr->workspaces[scr->current_workspace]->clip) {
+        all_docks[ i++ ] = scr->workspaces[scr->current_workspace]->clip;
+    }
+
+    assert(i == scr->drawer_count + 2
+           - wPreferences.flags.nodock - wPreferences.flags.noclip);
+    for ( ; i < scr->drawer_count + 2; i++)
+        all_docks[ i ] = NULL;
 
     wins[0] = icon->core->window;
     wins[1] = scr->dock_shadow;
     XRestackWindows(dpy, wins, 2);
+    XMoveResizeWindow(dpy, scr->dock_shadow, aicon->x_pos, aicon->y_pos,
+		      ICON_SIZE, ICON_SIZE); /* Daniel: was only in dock.c */
     if (superfluous) {
         if (icon->pixmap!=None)
             ghost = MakeGhostIcon(scr, icon->pixmap);
         else
             ghost = MakeGhostIcon(scr, icon->core->window);
-        XSetWindowBackgroundPixmap(dpy, scr->dock_shadow,
-                                   ghost);
+        XSetWindowBackgroundPixmap(dpy, scr->dock_shadow, ghost);
         XClearWindow(dpy, scr->dock_shadow);
     }
+    if (ondock)
+        XMapWindow(dpy, scr->dock_shadow);
 
     while (!done) {
         WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
@@ -673,8 +729,8 @@
 
         case MotionNotify:
             if (!grabbed) {
-                if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
-                    || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
+                if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
+                    || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
                     XChangeActivePointerGrab(dpy, ButtonMotionMask
                                              |ButtonReleaseMask|ButtonPressMask,
                                              wCursor[WCUR_MOVE], CurrentTime);
@@ -683,73 +739,86 @@
                     break;
                 }
             }
-            x = ev.xmotion.x_root - dx;
-            y = ev.xmotion.y_root - dy;
-
-            if (movingSingle) {
-                XMoveWindow(dpy, icon->core->window, x, y);
-            } else {
-                wAppIconMove(aicon, x, y);
+            if (omnipresent && !shown_clip_icons) {
+                for (i=0; i<scr->workspace_count; i++) {
+                    if (i == scr->current_workspace)
+                        continue;
+                    wDockShowIcons(scr->workspaces[i]->clip);
+                    /* Pb: if dock is collapsed (for instance, because
+                       it auto-collapses), its icons won't be shown. */
+                }
+                shown_clip_icons = True; /* avoid flickering */
             }
 
-            if (dockable) {
-                if (scr->dock && wDockSnapIcon(scr->dock, aicon, x, y,
-                                               &ix, &iy, False)) {
-                    shad_x = scr->dock->x_pos + ix*wPreferences.icon_size;
-                    shad_y = scr->dock->y_pos + iy*wPreferences.icon_size;
-
-                    if (scr->last_dock != scr->dock && collapsed) {
-                        scr->last_dock->collapsed = 1;
-                        wDockHideIcons(scr->last_dock);
-                        collapsed = 0;
-                    }
-                    if (!collapsed && (collapsed = scr->dock->collapsed)) {
-                        scr->dock->collapsed = 0;
-                        wDockShowIcons(scr->dock);
-                    }
-
-                    if (scr->dock->auto_raise_lower)
-                        wDockRaise(scr->dock);
-
-                    scr->last_dock = scr->dock;
-
-                    XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
-                    if (!docking) {
-                        XMapWindow(dpy, scr->dock_shadow);
+            x = ev.xmotion.x_root - ofs_x;
+            y = ev.xmotion.y_root - ofs_y;
+            if (dockable && !(aicon->running && (ev.xmotion.state & MOD_MASK))) {
+                for (i = 0; i < scr->drawer_count + 2; i++) {
+                    WDock *the_dock;
+                    if ((the_dock = all_docks[ i ]) == NULL)
+                        continue;
+                    tmp = wDockSnapIcon(the_dock, aicon,
+                                        x, y, &ix, &iy, (the_dock == original_dock));
+                    if (tmp) {
+                        /* Leave the dock we come from back in the
+                         * state we found it */
+                        if (last_dock && last_dock != the_dock) {
+                            if (last_dock->type == WM_DRAWER) {
+                                wDrawerFillTheGap(last_dock, aicon, (last_dock == original_dock));
+                            }
+                            if (collapsed) {
+                                last_dock->collapsed = 1;
+                                wDockHideIcons(last_dock);
+                                collapsed = 0;
+                            }
+                            if (last_dock->auto_raise_lower) {
+                                wDockLower(last_dock);
+                            }
+                        }
+                        /* expand this dock (if it's collapsed), save its state,
+                         * and do all this only once. All this is contained in the
+                         * following tests ! */
+                        if (!collapsed && (collapsed = the_dock->collapsed)) {
+                            the_dock->collapsed = 0;
+                            wDockShowIcons(the_dock);
+                        }
+                        /* if relevant, raise the new dock */
+                        if (last_dock != the_dock && the_dock->auto_raise_lower) {
+                            wDockRaise(the_dock);
+                            /* And raise the moving tile */
+                            wRaiseFrame(aicon->icon->core);
+                        }
+                        last_dock = the_dock;
+                        break;
                     }
-                    docking = 1;
-                } else if (workspace->clip &&
-                           wDockSnapIcon(workspace->clip, aicon, x, y,
-                                         &ix, &iy, False)) {
-                    shad_x = workspace->clip->x_pos + ix*wPreferences.icon_size;
-                    shad_y = workspace->clip->y_pos + iy*wPreferences.icon_size;
-
-                    if (scr->last_dock != workspace->clip && collapsed) {
-                        scr->last_dock->collapsed = 1;
-                        wDockHideIcons(scr->last_dock);
-                        collapsed = 0;
-                    }
-                    if (!collapsed && (collapsed = workspace->clip->collapsed)) {
-                        workspace->clip->collapsed = 0;
-                        wDockShowIcons(workspace->clip);
-                    }
-
-                    if (workspace->clip->auto_raise_lower)
-                        wDockRaise(workspace->clip);
+                }
+            }
 
-                    scr->last_dock = workspace->clip;
+            if ((!original_dock && tmp) ||
+                (original_dock && (aicon->launching
+                                   || aicon->lock
+                                   || (aicon->running && !(ev.xmotion.state & MOD_MASK))
+                                   || (!aicon->running && tmp)))) {
+                shad_x = last_dock->x_pos + ix*wPreferences.icon_size;
+                shad_y = last_dock->y_pos + iy*wPreferences.icon_size;
+
+		XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
+
+		if (!ondock) {
+		    XMapWindow(dpy, scr->dock_shadow);
+		}
+		ondock = 1;
+	    } else {
+                if (ondock) {
+                    XUnmapWindow(dpy, scr->dock_shadow);
 
-                    XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
-                    if (!docking) {
-                        XMapWindow(dpy, scr->dock_shadow);
+                    if (last_dock->type == WM_DRAWER) {
+                        wDrawerFillTheGap(last_dock, aicon, (last_dock == original_dock));
                     }
-                    docking = 1;
-                } else if (docking) {
-                    XUnmapWindow(dpy, scr->dock_shadow);
-                    docking = 0;
                 }
-            }
-
+		ondock = 0;
+	    }
+	    XMoveWindow(dpy, icon->core->window, x, y);
             break;
 
         case ButtonPress:
@@ -760,61 +829,137 @@
                 break;
             XUngrabPointer(dpy, CurrentTime);
 
-            if (docking) {
+	    if (ondock) {
                 Bool docked;
 
-                /* icon is trying to be docked */
-                SlideWindow(icon->core->window, x, y, shad_x, shad_y);
+		SlideWindow(icon->core->window, x, y, shad_x, shad_y);
                 XUnmapWindow(dpy, scr->dock_shadow);
-                docked = wDockAttachIcon(scr->last_dock, aicon, ix, iy);
-                if (scr->last_dock->auto_collapse) {
-                    collapsed = 0;
+
+                if (original_dock == NULL) { /* an undocked appicon trying to be docked */
+                    docked = wDockAttachIcon(last_dock, aicon, ix, iy);
+                    if (!docked) {
+                        /* if aicon wanted to go in a drawer, fill the gap */
+                        if (last_dock->type == WM_DRAWER) {
+                            wDrawerFillTheGap(last_dock, aicon, False);
+                        }
+                        /* If icon could not be docked, slide it back
+                         * to the old position */
+                        SlideWindow(icon->core->window, x, y, oldX, oldY);
+                    } else {
+                        wSoundPlay(WSOUND_DOCK);
+                    }
+                } else { /* a docked appicon, moving */
+                    if (original_dock == last_dock) {
+                        wDockReattachIcon(original_dock, aicon, ix, iy);
+
+                        for (i = 0; i < scr->drawer_count + 2; i++) {
+                            if (all_docks[i] && all_docks[i] != original_dock &&
+                                all_docks[i]->auto_raise_lower)
+                                wDockLower(all_docks[i]);
+                        }
+                    } else {
+                        docked = wDockMoveIconBetweenDocks(original_dock, last_dock, aicon, ix, iy);
+                        if (!docked) { /* aicon got rejected ! */
+                            /* if aicon wanted to go in a drawer, fill the gap */
+                            if (last_dock->type == WM_DRAWER) {
+                                wmessage("A drawer rejected the appicon !");
+                                wDrawerFillTheGap(last_dock, aicon, False);
+                            }
+                            /* If aicon comes from a drawer, make some room for it */
+                            if (original_dock->type == WM_DRAWER) {
+                                WAppIcon *aicons_to_shift[ original_dock->icon_count ];
+                                int j = 0;
+
+                                for (i = 0; i < original_dock->max_icons; i++) {
+                                    WAppIcon *ai = original_dock->icon_array[ i ];
+                                    if (ai && ai != aicon &&
+                                        abs(ai->xindex) >= abs(aicon->xindex))
+                                        aicons_to_shift[ j++ ] = ai;
+                                }
+                                if (j != original_dock->icon_count - abs(aicon->xindex) - 1)
+                                    wwarning("Shifting j=%d appicons (instead of %d!) to reinsert aicon at index %d.",
+                                             j, original_dock->icon_count - abs(aicon->xindex) - 1, aicon->xindex);
+                                wSlideAppicons(aicons_to_shift, j, original_dock->on_right_side);
+                            }
+                            SlideWindow(icon->core->window, x, y, aicon->x_pos,
+                                        aicon->y_pos);
+                            wDockReattachIcon(original_dock, aicon, aicon->xindex,aicon->yindex);
+                        }
+                        if ((last_dock->type == WM_CLIP || last_dock->type == WM_DRAWER)
+                            && last_dock->auto_collapse) {
+                            collapsed = 0;
+                        }
+                    }
                 }
-                if (workspace->clip &&
-                    workspace->clip != scr->last_dock &&
-                    workspace->clip->auto_raise_lower)
-                    wDockLower(workspace->clip);
-
-                if (!docked) {
-                    /* If icon could not be docked, slide it back to the old
-                     * position */
-                    SlideWindow(icon->core->window, x, y, oldX, oldY);
+            } else { /* ! ondock */
+                aicon->x_pos = x;
+                aicon->y_pos = y;
+
+                if (tmp) { /* maybe it could be docked but MOD was pressed */
+                    if (!last_dock) {
+                        wwarning("last_dock is null but tmp is true !");
+                    } else {
+                        if (last_dock->type == WM_DRAWER) {
+                            wDrawerFillTheGap(last_dock, aicon, (original_dock == last_dock));
+                        }
+                    }
                 }
 
-                wSoundPlay(WSOUND_DOCK);
-            } else {
-                if (movingSingle) {
-                    /* move back to its place */
-                    SlideWindow(icon->core->window, x, y, oldX, oldY);
-                    wAppIconMove(aicon, oldX, oldY);
-                } else {
-                    XMoveWindow(dpy, icon->core->window, x, y);
-                    aicon->x_pos = x;
-                    aicon->y_pos = y;
+                if (original_dock == NULL) { /* undocked appicon still undocked */
+		    XMoveWindow(dpy, icon->core->window, x, y);
+
+                    for (i = 0; i < scr->drawer_count + 2; i++) {
+                        if (all_docks[i] && all_docks[i]->auto_raise_lower)
+                            wDockLower(all_docks[i]);
+                    }
+                } else { /* detach docked appicon */
+                    if (superfluous) {
+                        if (!aicon->running && !wPreferences.no_animations) {
+                            /* We need to deselect it, even if is deselected
+                             * in wDockDetach(), because else DoKaboom() will
+                             * fail. */
+                            if (aicon->icon->selected)
+                                wIconSelect(aicon->icon);
+
+                            wSoundPlay(WSOUND_KABOOM);
+                            DoKaboom(scr,aicon->icon->core->window, x, y);
+                        } else {
+                            wSoundPlay(WSOUND_UNDOCK);
+                        }
+                    } else {
+                        wSoundPlay(WSOUND_UNDOCK);
+                    }
+
+                    for (i = 0; i < scr->drawer_count + 2; i++) {
+                        if (all_docks[i] && all_docks[i]->auto_raise_lower)
+                            wDockLower(all_docks[i]);
+                    }
+                    wDockDetach(original_dock, aicon);
                 }
-                if (workspace->clip && workspace->clip->auto_raise_lower)
-                    wDockLower(workspace->clip);
             }
             if (collapsed) {
-                scr->last_dock->collapsed = 1;
-                wDockHideIcons(scr->last_dock);
+                last_dock->collapsed = 1;
+                wDockHideIcons(last_dock);
                 collapsed = 0;
             }
             if (superfluous) {
-                if (ghost!=None)
-                    XFreePixmap(dpy, ghost);
-                XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
+		if (ghost!=None)
+		    XFreePixmap(dpy, ghost);
+		XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
+            }
+            if (shown_clip_icons) {
+                for (i=0; i<scr->workspace_count; i++) {
+                    if (i == scr->current_workspace)
+                        continue;
+                    wDockHideIcons(scr->workspaces[i]->clip);
+                }
             }
-
             if (wPreferences.auto_arrange_icons)
-                wArrangeIcons(scr, True);
-
-            done = 1;
-            break;
-        }
-    }
+                wArrangeIcons(scr, True); /* Daniel: was only in appicon.c */
 #ifdef DEBUG
-    puts("End icon move");
+	    puts("End appicon move");
 #endif
-
+            return;
+        }
+    }
 }
diff -Naur WindowMaker-0.92.0-orig/src/appicon.h WindowMaker-0.92.0/src/appicon.h
--- WindowMaker-0.92.0-orig/src/appicon.h	2004-10-14 19:31:49.000000000 +0200
+++ WindowMaker-0.92.0/src/appicon.h	2007-01-10 23:45:02.000000000 +0100
@@ -97,5 +97,7 @@
 
 void wAppIconMove(WAppIcon *aicon, int x, int y);
 
+void wHandleAppIconMove(WAppIcon *aicon, XEvent *event);
+
 #endif
 
diff -Naur WindowMaker-0.92.0-orig/src/application.c WindowMaker-0.92.0/src/application.c
--- WindowMaker-0.92.0-orig/src/application.c	2005-03-11 22:35:36.000000000 +0100
+++ WindowMaker-0.92.0/src/application.c	2007-01-10 23:45:02.000000000 +0100
@@ -332,7 +332,7 @@
         if (!wapp->app_icon && scr->dock) {
             wapp->app_icon = findDockIconFor(scr->dock, main_window);
         }
-        /* finally check clips */
+        /* Check clips */
         if (!wapp->app_icon) {
             int i;
             for (i=0; i<scr->workspace_count; i++) {
@@ -343,6 +343,15 @@
                     break;
             }
         }
+        /* Check drawers too */
+        if (!wapp->app_icon) {
+            WDrawerChain *dc;
+            for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+                wapp->app_icon = findDockIconFor(dc->adrawer, main_window);
+                if (wapp->app_icon)
+                    break;
+            }
+        }
 
         if (wapp->app_icon) {
             WWindow *mainw = wapp->main_window_desc;
@@ -366,23 +375,29 @@
 
     if (wapp->app_icon && !wapp->app_icon->docked) {
         WIcon *icon = wapp->app_icon->icon;
-        WDock *clip = scr->workspaces[scr->current_workspace]->clip;
+        WDock *attracting_dock;
         int x=0, y=0;
 
-        if (clip && clip->attract_icons && wDockFindFreeSlot(clip, &x, &y)) {
+        if (scr->attracting_drawer)
+            attracting_dock = scr->attracting_drawer;
+        else
+            attracting_dock = scr->workspaces[scr->current_workspace]->clip;
+
+        if (attracting_dock && attracting_dock->attract_icons &&
+            wDockFindFreeSlot(attracting_dock, &x, &y)) {
             wapp->app_icon->attracted = 1;
             if (!icon->shadowed) {
                 icon->shadowed = 1;
                 icon->force_paint = 1;
                 /* wAppIconPaint() is done in wDockAttachIcon() below */
             }
-            wDockAttachIcon(clip, wapp->app_icon, x, y);
+            wDockAttachIcon(attracting_dock, wapp->app_icon, x, y);
         } else {
             PlaceIcon(scr, &x, &y, wGetHeadForWindow(wapp->main_window_desc));
             wAppIconMove(wapp->app_icon, x, y);
             wLowerFrame(icon->core);
         }
-        if (!clip || !wapp->app_icon->attracted || !clip->collapsed)
+        if (!wapp->app_icon->attracted || !attracting_dock->collapsed)
             XMapWindow(dpy, icon->core->window);
     }
 
@@ -479,6 +494,9 @@
             wAppIconPaint(wapp->app_icon);
         } else if (wapp->app_icon->docked) {
             wapp->app_icon->running = 0;
+            if (wapp->app_icon->dock->type == WM_DRAWER) {
+                wDrawerFillTheGap(wapp->app_icon->dock, wapp->app_icon, True);
+            }
             wDockDetach(wapp->app_icon->dock, wapp->app_icon);
         } else {
             wAppIconDestroy(wapp->app_icon);
diff -Naur WindowMaker-0.92.0-orig/src/defaults.c WindowMaker-0.92.0/src/defaults.c
--- WindowMaker-0.92.0-orig/src/defaults.c	2007-01-10 23:36:31.000000000 +0100
+++ WindowMaker-0.92.0/src/defaults.c	2007-01-10 23:45:03.000000000 +0100
@@ -1509,6 +1509,7 @@
 wDefaultUpdateIcons(WScreen *scr)
 {
     WAppIcon *aicon = scr->app_icon_list;
+    WDrawerChain *dc;
     WWindow *wwin = scr->focused_window;
     char *file;
 
@@ -1536,6 +1537,9 @@
     if (!wPreferences.flags.noclip)
         wClipIconPaint(scr->clip_icon);
 
+    for (dc = scr->drawers; dc != NULL; dc = dc->next)
+        wDrawerIconPaint(dc->adrawer->icon_array[0]);
+
     while (wwin) {
         if (wwin->icon && wwin->flags.miniaturized) {
             file = wDefaultGetIconFile(scr, wwin->wm_instance, wwin->wm_class,
@@ -3005,6 +3009,11 @@
         scr->clip_tile = wClipMakeTile(scr, img);
     }
 
+    if (scr->drawer_tile) {
+        RReleaseImage(scr->drawer_tile);
+    }
+    scr->drawer_tile = wDrawerMakeTile(scr, img);
+
     scr->icon_tile_pixmap = pixmap;
 
     if (scr->def_icon_pixmap) {
diff -Naur WindowMaker-0.92.0-orig/src/defaults.h WindowMaker-0.92.0/src/defaults.h
--- WindowMaker-0.92.0-orig/src/defaults.h	2004-10-12 19:54:32.000000000 +0200
+++ WindowMaker-0.92.0/src/defaults.h	2007-01-10 23:45:03.000000000 +0100
@@ -63,5 +63,7 @@
 
 void wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file);
 
+void wDefaultPurgeInfo(WScreen *scr, char *instance, char *class);
+
 #endif /* WMDEFAULTS_H_ */
 
diff -Naur WindowMaker-0.92.0-orig/src/dock.c WindowMaker-0.92.0/src/dock.c
--- WindowMaker-0.92.0-orig/src/dock.c	2007-01-10 23:36:31.000000000 +0100
+++ WindowMaker-0.92.0/src/dock.c	2007-01-10 23:45:03.000000000 +0100
@@ -105,6 +105,8 @@
 
 static WMPropList *dAutoCollapse, *dAutoRaiseLower, *dOmnipresent;
 
+static WMPropList *dDrawers = NULL;
+
 static void dockIconPaint(WAppIcon *btn);
 
 static void iconMouseDown(WObjDescriptor *desc, XEvent *event);
@@ -125,8 +127,6 @@
 
 static void handleClipChangeWorkspace(WScreen *scr, XEvent *event);
 
-Bool moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y);
-
 static void clipEnterNotify(WObjDescriptor *desc, XEvent *event);
 static void clipLeaveNotify(WObjDescriptor *desc, XEvent *event);
 static void clipAutoCollapse(void *cdata);
@@ -138,6 +138,16 @@
 
 static void showClipBalloon(WDock *dock, int workspace);
 
+static void drawerIconExpose(WObjDescriptor *desc, XEvent *event);
+static void removeDrawerCallback(WMenu *menu, WMenuEntry *entry);
+static void drawerAppendToChain(WScreen *scr, WDock *drawer);
+static char *findUniqueName(WScreen *scr, char *instance_basename);
+static void addADrawerCallback(WMenu *menu, WMenuEntry *entry);
+static void swapDrawers(WScreen *scr, int on_right_side, int new_x);
+static int isADrawer(WScreen *scr, WAppIcon *aicon);
+static WDock* getDrawer(WScreen *scr, int y_index);
+static int indexOfHole(WDock *drawer, WAppIcon *moving_aicon, int redocking);
+
 
 
 static void
@@ -172,6 +182,7 @@
 
     dDock = WMCreatePLString("Dock");
     dClip = WMCreatePLString("Clip");
+    dDrawers = WMCreatePLString("Drawers");
 }
 
 
@@ -526,14 +537,37 @@
 
 
 static void
+removeIcons(WMArray *icons, WDock *dock)
+{
+    WAppIcon *aicon;
+    int keepit;
+    WMArrayIterator it;
+
+    WM_ITERATE_ARRAY(icons, aicon, it) {
+        keepit = aicon->running && wApplicationOf(aicon->main_window);
+        wDockDetach(dock, aicon);
+        if (keepit) {
+            /* XXX: can: aicon->icon == NULL ? */
+            PlaceIcon(dock->screen_ptr, &aicon->x_pos, &aicon->y_pos, wGetHeadForWindow(aicon->icon->owner));
+            XMoveWindow(dpy, aicon->icon->core->window,
+                        aicon->x_pos, aicon->y_pos);
+            if (!dock->mapped || dock->collapsed)
+                XMapWindow(dpy, aicon->icon->core->window);
+        }
+    }
+    WMFreeArray(icons);
+
+    if (wPreferences.auto_arrange_icons)
+        wArrangeIcons(dock->screen_ptr, True);
+}
+
+
+static void
 removeIconsCallback(WMenu *menu, WMenuEntry *entry)
 {
     WAppIcon *clickedIcon = (WAppIcon*)entry->clientdata;
     WDock *dock;
-    WAppIcon *aicon;
     WMArray *selectedIcons;
-    int keepit;
-    WMArrayIterator it;
 
     assert(clickedIcon!=NULL);
 
@@ -542,7 +576,8 @@
     selectedIcons = getSelected(dock);
 
     if (WMGetArrayItemCount(selectedIcons)) {
-        if (wMessageDialog(dock->screen_ptr, _("Workspace Clip"),
+        if (wMessageDialog(dock->screen_ptr,
+                           dock->type == WM_CLIP ? _("Workspace Clip") : _("Drawer"),
                            _("All selected icons will be removed!"),
                            _("OK"), _("Cancel"), NULL)!=WAPRDefault) {
             WMFreeArray(selectedIcons);
@@ -556,22 +591,7 @@
         WMAddToArray(selectedIcons, clickedIcon);
     }
 
-    WM_ITERATE_ARRAY(selectedIcons, aicon, it) {
-        keepit = aicon->running && wApplicationOf(aicon->main_window);
-        wDockDetach(dock, aicon);
-        if (keepit) {
-            /* XXX: can: aicon->icon == NULL ? */
-            PlaceIcon(dock->screen_ptr, &aicon->x_pos, &aicon->y_pos, wGetHeadForWindow(aicon->icon->owner));
-            XMoveWindow(dpy, aicon->icon->core->window,
-                        aicon->x_pos, aicon->y_pos);
-            if (!dock->mapped || dock->collapsed)
-                XMapWindow(dpy, aicon->icon->core->window);
-        }
-    }
-    WMFreeArray(selectedIcons);
-
-    if (wPreferences.auto_arrange_icons)
-        wArrangeIcons(dock->screen_ptr, True);
+    removeIcons(selectedIcons, dock);
 }
 
 
@@ -639,9 +659,34 @@
 toggleAutoAttractCallback(WMenu *menu, WMenuEntry *entry)
 {
     WDock *dock = (WDock*)entry->clientdata;
+    WScreen *scr = dock->screen_ptr;
 
     assert(entry->clientdata!=NULL);
 
+    /* Ask confirmation if the action has some side-effects */
+    if (dock->type == WM_CLIP && scr->attracting_drawer) {
+        if (wMessageDialog(scr, _("Workspace Clip"),
+                           _("The drawer that auto-attracted icons so far won't do so anymore!"),
+                           _("OK"), _("Cancel"), NULL)!=WAPRDefault)
+            return;
+    } else if (dock->type == WM_DRAWER) {
+        /* check if at least one clip already auto attracts icons */
+        int i, ask_for_confirmation = False;
+        for (i = 0; i < scr->workspace_count; i++) {
+            if (scr->workspaces[ i ]->clip->attract_icons) {
+                ask_for_confirmation = True;
+                break;
+            }
+        }
+        if (ask_for_confirmation) {
+            if (wMessageDialog(scr, _("Drawer"),
+                               _("Any clips that auto-attracted icons so far won't do so anymore!"),
+                               _("OK"), _("Cancel"), NULL)!=WAPRDefault)
+                return;
+        }
+    }
+
+    /* direct effect */
     dock->attract_icons = !dock->attract_icons;
     /*if (!dock->attract_icons)
      dock->keep_attracted = 0;*/
@@ -649,6 +694,26 @@
     entry->flags.indicator_on = dock->attract_icons;
 
     wMenuPaint(menu);
+
+    /* side-effects */
+    if (dock->attract_icons) {
+        if (dock->type == WM_DRAWER) {
+            int i;
+            for (i = 0; i < scr->workspace_count; i++) {
+                scr->workspaces[ i ]->clip->attract_icons = False;
+                /* dock menu will be updated later, when opened */
+            }
+            if (scr->attracting_drawer != NULL)
+                scr->attracting_drawer->attract_icons = False;
+            scr->attracting_drawer = dock;
+        } else {
+            if (scr->attracting_drawer != NULL) {
+                scr->attracting_drawer->attract_icons = False;
+                /* again, its menu will be updated, later. */
+                scr->attracting_drawer = NULL;
+            }
+        }
+    }
 }
 
 
@@ -669,7 +734,7 @@
 colectIconsCallback(WMenu *menu, WMenuEntry *entry)
 {
     WAppIcon *clickedIcon = (WAppIcon*)entry->clientdata;
-    WDock *clip;
+    WDock *clip; /* clip... is a WM_CLIP or a WM_DRAWER */
     WAppIcon *aicon;
     int x, y, x_pos, y_pos;
 
@@ -838,13 +903,17 @@
 }
 
 
+/* Name is only used when type == WM_DRAWER and when restoring a specific
+ * drawer, with a specific name. When creating a drawer, leave name to NULL
+ * and mainIconCreate will find the first unused unique name */
 WAppIcon*
-mainIconCreate(WScreen *scr, int type)
+mainIconCreate(WScreen *scr, int type, char *name)
 {
     WAppIcon *btn;
     int x_pos;
 
-    if (type == WM_CLIP) {
+    switch(type) {
+    case WM_CLIP:
         if (scr->clip_icon)
             return scr->clip_icon;
         btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMClip", TILE_CLIP);
@@ -853,9 +922,20 @@
         btn->icon->core->descriptor.handle_leavenotify = clipLeaveNotify;
         /*x_pos = scr->scr_width - ICON_SIZE*2 - DOCK_EXTRA_SPACE;*/
         x_pos = 0;
-    } else {
+        break;
+    case WM_DOCK:
+    default: /* to avoid a warning about btn and x_pos, basically */
         btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMDock", TILE_NORMAL);
         x_pos = scr->scr_width - ICON_SIZE - DOCK_EXTRA_SPACE;
+        break;
+    case WM_DRAWER:
+        if (name == NULL)
+            name = findUniqueName(scr, "Drawer");
+        btn = wAppIconCreateForDock(scr, NULL, name, "WMDrawer", TILE_DRAWER);
+        btn->icon->core->descriptor.handle_expose = drawerIconExpose;
+        btn->icon->core->descriptor.handle_enternotify = clipEnterNotify;
+        btn->icon->core->descriptor.handle_leavenotify = clipLeaveNotify;
+        x_pos = 0;
     }
 
     btn->xindex = 0;
@@ -897,13 +977,13 @@
 
         WM_ITERATE_ARRAY(selectedIcons, btn, iter) {
             if (wDockFindFreeSlot(dest, &x, &y)) {
-                moveIconBetweenDocks(src, dest, btn, x, y);
+                wDockMoveIconBetweenDocks(src, dest, btn, x, y);
                 XUnmapWindow(dpy, btn->icon->core->window);
             }
         }
     } else if (icon != scr->clip_icon) {
         if (wDockFindFreeSlot(dest, &x, &y)) {
-            moveIconBetweenDocks(src, dest, icon, x, y);
+            wDockMoveIconBetweenDocks(src, dest, icon, x, y);
             XUnmapWindow(dpy, icon->icon->core->window);
         }
     }
@@ -1116,23 +1196,37 @@
     if (type == WM_CLIP && scr->clip_menu)
         return scr->clip_menu;
 
+    if (type == WM_DRAWER && scr->drawer_menu)
+        return scr->drawer_menu;
+
     menu = wMenuCreate(scr, NULL, False);
-    if (type != WM_CLIP) {
+    if (type == WM_DOCK) {
         entry = wMenuAddCallback(menu, _("Keep on Top"),
                                  toggleLoweredCallback, NULL);
         entry->flags.indicator = 1;
         entry->flags.indicator_on = 1;
         entry->flags.indicator_type = MI_CHECK;
-    } else {
-        entry = wMenuAddCallback(menu, _("Clip Options"), NULL, NULL);
-        scr->clip_options = makeClipOptionsMenu(scr);
-        if (scr->clip_options)
-            wMenuEntrySetCascade(menu, entry, scr->clip_options);
 
-        entry = wMenuAddCallback(menu, _("Rename Workspace"), renameCallback,
-                                 NULL);
-        wfree(entry->text);
-        entry->text = _("Rename Workspace");
+        entry = wMenuAddCallback(menu, _("Add a drawer"),
+                                 addADrawerCallback, NULL);
+    } else {
+        if (type == WM_CLIP)
+            entry = wMenuAddCallback(menu, _("Clip Options"), NULL, NULL);
+        else /* if (type == WM_DRAWER) */
+            entry = wMenuAddCallback(menu, _("Drawer options"), NULL, NULL);
+
+        if (scr->clip_options == NULL)
+            scr->clip_options = makeClipOptionsMenu(scr);
+        wMenuEntrySetCascade(menu, entry, scr->clip_options);
+
+        if (type == WM_CLIP) {
+            entry = wMenuAddCallback(menu, _("Rename Workspace"), renameCallback,
+                                     NULL);
+            /* If the text entry may change, free the duplicated string (from
+             * wMenuInsertCallback) and use gettext's string */
+            wfree(entry->text);
+            entry->text = _("Rename Workspace"); /* can be: (Toggle) Omnipresent */
+        }
 
         entry = wMenuAddCallback(menu, _("Selected"), selectCallback, NULL);
         entry->flags.indicator = 1;
@@ -1142,23 +1236,25 @@
         entry = wMenuAddCallback(menu, _("Select All Icons"),
                                  selectIconsCallback, NULL);
         wfree(entry->text);
-        entry->text = _("Select All Icons");
+        entry->text = _("Select All Icons"); /* can be: Unselect all icons */
 
         entry = wMenuAddCallback(menu, _("Keep Icon"), keepIconsCallback, NULL);
         wfree(entry->text);
-        entry->text = _("Keep Icon");
+        entry->text = _("Keep Icon"); /* can be: Keep Icons */
 
-        entry = wMenuAddCallback(menu, _("Move Icon To"), NULL, NULL);
-        wfree(entry->text);
-        entry->text = _("Move Icon To");
-        scr->clip_submenu = makeWorkspaceMenu(scr);
-        if (scr->clip_submenu)
-            wMenuEntrySetCascade(menu, entry, scr->clip_submenu);
+        if (type == WM_CLIP) {
+            entry = wMenuAddCallback(menu, _("Move Icon To"), NULL, NULL);
+            wfree(entry->text);
+            entry->text = _("Move Icon To"); /* can be: Move Icons to */
+            scr->clip_submenu = makeWorkspaceMenu(scr);
+            if (scr->clip_submenu)
+                wMenuEntrySetCascade(menu, entry, scr->clip_submenu);
+        }
 
         entry = wMenuAddCallback(menu, _("Remove Icon"), removeIconsCallback,
                                  NULL);
         wfree(entry->text);
-        entry->text = _("Remove Icon");
+        entry->text = _("Remove Icon"); /* can be: Remove Icons */
 
         wMenuAddCallback(menu, _("Attract Icons"), colectIconsCallback, NULL);
     }
@@ -1169,21 +1265,26 @@
 
     entry = wMenuAddCallback(menu, _("Hide"), hideCallback, NULL);
     wfree(entry->text);
-    entry->text = _("Hide");
+    entry->text = _("Hide"); /* can be: Unhide */
 
     wMenuAddCallback(menu, _("Settings..."), settingsCallback, NULL);
 
-    wMenuAddCallback(menu, _("Kill"), killCallback, NULL);
+    entry = wMenuAddCallback(menu, _("Kill"), killCallback, NULL);
+    wfree(entry->text);
+    entry->text = _("Kill"); /* can be: Remove drawer */
 
     if (type == WM_CLIP)
         scr->clip_menu = menu;
 
+    if (type == WM_DRAWER)
+        scr->drawer_menu = menu;
+
     return menu;
 }
 
 
 WDock*
-wDockCreate(WScreen *scr, int type)
+wDockCreate(WScreen *scr, int type, char *name)
 {
     WDock *dock;
     WAppIcon *btn;
@@ -1194,17 +1295,24 @@
     dock = wmalloc(sizeof(WDock));
     memset(dock, 0, sizeof(WDock));
 
-    if (type == WM_CLIP)
+    switch (type) {
+    case WM_CLIP:
         icon_count = CLIP_MAX_ICONS;
-    else
+        break;
+    case WM_DOCK:
+    default:
         icon_count = scr->scr_height/wPreferences.icon_size;
+        break;
+    case WM_DRAWER:
+        icon_count = scr->scr_width/wPreferences.icon_size;
+    }
 
     dock->icon_array = wmalloc(sizeof(WAppIcon*)*icon_count);
     memset(dock->icon_array, 0, sizeof(WAppIcon*)*icon_count);
 
     dock->max_icons = icon_count;
 
-    btn = mainIconCreate(scr, type);
+    btn = mainIconCreate(scr, type, name);
 
     btn->dock = dock;
 
@@ -1213,22 +1321,35 @@
     dock->screen_ptr = scr;
     dock->type = type;
     dock->icon_count = 1;
-    dock->on_right_side = 1;
+    if (type == WM_DRAWER)
+        dock->on_right_side = scr->dock->on_right_side;
+    else
+        dock->on_right_side = 1;
     dock->collapsed = 0;
     dock->auto_collapse = 0;
     dock->auto_collapse_magic = NULL;
-    dock->auto_raise_lower = 0;
+    dock->auto_raise_lower = (type == WM_DRAWER ? 1 : 0);
     dock->auto_lower_magic = NULL;
     dock->auto_raise_magic = NULL;
     dock->attract_icons = 0;
     dock->lowered = 1;
     dock->icon_array[0] = btn;
+    if (type == WM_DRAWER) {
+        if (scr->dock->lowered) /* Because drawer is lowered, its main
+                                 * tile is at the same level as the dock. */
+            ChangeStackingLevel(btn->icon->core, WMNormalLevel);
+        else
+            ChangeStackingLevel(btn->icon->core, WMDockLevel);
+    }
     wRaiseFrame(btn->icon->core);
     XMoveWindow(dpy, btn->icon->core->window, btn->x_pos, btn->y_pos);
 
     /* create dock menu */
     dock->menu = dockMenuCreate(scr, type);
 
+    if (type == WM_DRAWER)
+        drawerAppendToChain(scr, dock);
+
     return dock;
 }
 
@@ -1327,6 +1448,8 @@
 {
     if (btn == btn->icon->core->screen_ptr->clip_icon)
         wClipIconPaint(btn);
+    else if (isADrawer(btn->icon->core->screen_ptr, btn))
+        wDrawerIconPaint(btn);
     else
         wAppIconPaint(btn);
 }
@@ -1453,7 +1576,7 @@
     value = (dock->lowered ? dYes : dNo);
     WMPutInPLDictionary(dock_state, dLowered, value);
 
-    if (dock->type == WM_CLIP) {
+    if (dock->type == WM_CLIP || dock->type == WM_DRAWER) {
         value = (dock->collapsed ? dYes : dNo);
         WMPutInPLDictionary(dock_state, dCollapsed, value);
 
@@ -1599,7 +1722,7 @@
     }
 
     aicon->icon->core->descriptor.handle_mousedown = iconMouseDown;
-    if (type == WM_CLIP) {
+    if (type == WM_CLIP || type == WM_DRAWER) {
         aicon->icon->core->descriptor.handle_enternotify = clipEnterNotify;
         aicon->icon->core->descriptor.handle_leavenotify = clipLeaveNotify;
     }
@@ -1680,7 +1803,7 @@
     WMPropList *value;
 
 
-    icon = mainIconCreate(scr, WM_CLIP);
+    icon = mainIconCreate(scr, WM_CLIP, NULL);
 
     if (!clip_state)
         return icon;
@@ -1740,7 +1863,7 @@
     int count, i;
 
 
-    dock = wDockCreate(scr, type);
+    dock = wDockCreate(scr, type, NULL);
 
     if (!dock_state)
         return dock;
@@ -2190,7 +2313,7 @@
     icon->docked = 1;
     icon->dock = dock;
     icon->icon->core->descriptor.handle_mousedown = iconMouseDown;
-    if (dock->type == WM_CLIP) {
+    if (dock->type == WM_CLIP || dock->type == WM_DRAWER) {
         icon->icon->core->descriptor.handle_enternotify = clipEnterNotify;
         icon->icon->core->descriptor.handle_leavenotify = clipLeaveNotify;
     }
@@ -2224,7 +2347,7 @@
 
 
 void
-reattachIcon(WDock *dock, WAppIcon *icon, int x, int y)
+wDockReattachIcon(WDock *dock, WAppIcon *icon, int x, int y)
 {
     int index;
 
@@ -2243,7 +2366,7 @@
 
 
 Bool
-moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y)
+wDockMoveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y)
 {
     WWindow *wwin;
     char *command;
@@ -2289,7 +2412,7 @@
         }
     }
 
-    if (dest->type == WM_DOCK)
+    if (dest->type == WM_DOCK || dest->type == WM_DRAWER)
         wClipMakeIconOmnipresent(icon, False);
 
     for(index=1; index<src->max_icons; index++) {
@@ -2328,7 +2451,7 @@
     /* set it to be kept when moving to dock.
      * Unless the icon does not have a command set
      */
-    if (icon->command && dest->type==WM_DOCK) {
+    if (icon->command && (dest->type == WM_DOCK || dest->type == WM_DRAWER)) {
         icon->attracted = 0;
         if (icon->icon->shadowed) {
             icon->icon->shadowed = 0;
@@ -2441,6 +2564,8 @@
  * Note: this function should NEVER alter ret_x or ret_y, unless it will
  * return True. -Dan
  */
+/* Redocking == true means either icon->dock == dock (normal case)
+ *                         or we are called from handleDockMove for a drawer */
 Bool
 wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
               int *ret_x, int *ret_y, int redocking)
@@ -2494,8 +2619,22 @@
             return False;
     }
 
-    if (dock->type == WM_DOCK) {
-        if (icon->dock != dock && ex_x != 0)
+    switch (dock->type) {
+    case WM_DOCK:
+    {
+        /* We can return False right away if
+         * - we do not come from this dock (which is a WM_DOCK),
+         * - we are not right over it, and
+         * - we are not the main tile of a drawer.
+         * In the latter case, we are called from handleDockMove. */
+	if (icon->dock != dock && ex_x != 0 &&
+            !(icon->dock && icon->dock->type == WM_DRAWER && icon == icon->dock->icon_array[0]))
+	    return False;
+
+	if (!redocking && ex_x != 0)
+            return False;
+
+        if (getDrawer(scr, ex_y)) /* Return false so that the drawer gets it. */
             return False;
 
         aicon = NULL;
@@ -2513,6 +2652,7 @@
             /* Possible cases when redocking:
              *
              * icon dragged out of range of any slot -> false
+             * icon dragged on a drawer -> false (to open the drawer)
              * icon dragged to range of free slot
              * icon dragged to range of same slot
              * icon dragged to range of different icon
@@ -2551,6 +2691,8 @@
                             break;
                         }
                     }
+                    /* slot is used by a drawer */
+                    done = done && !getDrawer(scr, closest);
                 }
                 sig = -sig;
             }
@@ -2571,7 +2713,10 @@
                 return True;
             }
         }
-    } else { /* CLIP */
+        break;
+    }
+    case WM_CLIP:
+    {
         int neighbours = 0;
         int start, stop, k;
 
@@ -2615,6 +2760,50 @@
             *ret_y = ex_y;
             return True;
         }
+        break;
+    }
+    case WM_DRAWER:
+    {
+        WAppIcon *aicons_to_shift[ dock->icon_count ];
+        int index_of_hole, j;
+
+        if (ex_y != 0 ||
+            abs(ex_x) - dock->icon_count > DOCK_DETTACH_THRESHOLD ||
+            (ex_x < 0 && !dock->on_right_side) ||
+            (ex_x > 0 &&  dock->on_right_side)) {
+            return False;
+        }
+
+        if (ex_x == 0)
+            ex_x = (dock->on_right_side ? -1 : 1);
+
+        /* "Reduce" ex_x but keep its sign */
+        if (redocking) {
+            if (abs(ex_x) > dock->icon_count - 1) /* minus 1: do not take icon_array[0] into account */
+                ex_x = ex_x * (dock->icon_count - 1) / abs(ex_x); /* don't use *= ! */
+        } else {
+            if (abs(ex_x) > dock->icon_count)
+                ex_x = ex_x * dock->icon_count / abs(ex_x);
+        }
+        index_of_hole = indexOfHole(dock, icon, redocking);
+
+        /* Find the appicons between where icon was (index_of_hole) and where
+         * it wants to be (ex_x) and slide them. */
+        j = 0;
+        for (i = 1; i < dock->max_icons; i++) {
+            if ((aicon = dock->icon_array[ i ]) && aicon != icon &&
+                ((ex_x <= aicon->xindex && aicon->xindex < index_of_hole) ||
+                 (index_of_hole < aicon->xindex && aicon->xindex <= ex_x)))
+                aicons_to_shift[ j++ ] = aicon;
+        }
+        assert(j == abs(ex_x - index_of_hole));
+
+        wSlideAppicons(aicons_to_shift, j, (index_of_hole < ex_x));
+
+        *ret_x = ex_x;
+        *ret_y = ex_y;
+        return True;
+    }
     }
     return False;
 }
@@ -2652,6 +2841,15 @@
     int sx=0, sy=0, ex=scr->scr_width, ey=scr->scr_height;
     int extra_count=0;
 
+    if (dock->type == WM_DRAWER) {
+        if (dock->icon_count >= dock->max_icons) { /* drawer is full */
+            return False;
+        }
+        *x_pos = dock->icon_count * (dock->on_right_side ? -1 : 1);
+        *y_pos = 0;
+        return True;
+    }
+
     if (dock->type == WM_CLIP &&
         dock != scr->workspaces[scr->current_workspace]->clip)
         extra_count = scr->global_icon_count;
@@ -2913,8 +3111,13 @@
 moveDock(WDock *dock, int new_x, int new_y)
 {
     WAppIcon *btn;
+    WDrawerChain *dc;
     int i;
 
+    if (dock->type == WM_DOCK) {
+        for (dc = dock->screen_ptr->drawers; dc != NULL; dc = dc->next)
+            moveDock(dc->adrawer, new_x, dc->adrawer->y_pos - dock->y_pos + new_y);
+    }
     dock->x_pos = new_x;
     dock->y_pos = new_y;
     for (i=0; i<dock->max_icons; i++) {
@@ -2942,6 +3145,8 @@
         x = dock->x_pos = DOCK_EXTRA_SPACE;
     }
 
+    swapDrawers(scr, dock->on_right_side, x);
+
     for (i=0; i<dock->max_icons; i++) {
         btn = dock->icon_array[i];
         if (btn) {
@@ -3012,7 +3217,8 @@
             state->hidden = -1;
             state->miniaturized = -1;
             state->shaded = -1;
-            if (btn->dock==scr->dock || btn->omnipresent)
+            if (btn->dock == scr->dock ||
+                btn->dock->type == WM_DRAWER || btn->omnipresent)
                 state->workspace = -1;
             else
                 state->workspace = scr->current_workspace;
@@ -3059,17 +3265,6 @@
     btn = dock->icon_array[0];
     moveDock(dock, btn->x_pos, btn->y_pos);
 
-    newlevel = dock->lowered ? WMNormalLevel : WMDockLevel;
-    ChangeStackingLevel(btn->icon->core, newlevel);
-
-    for (i=1; i<dock->max_icons; i++) {
-        if (dock->icon_array[i]) {
-            MoveInStackListAbove(dock->icon_array[i]->icon->core,
-                                 btn->icon->core);
-            break;
-        }
-    }
-
     if (!dock->collapsed) {
         for (i=1; i<dock->max_icons; i++) {
             if (dock->icon_array[i]) {
@@ -3087,7 +3282,12 @@
 wDockLower(WDock *dock)
 {
     int i;
+    WDrawerChain *dc;
 
+    if (dock->type == WM_DOCK) {
+        for (dc = dock->screen_ptr->drawers; dc != NULL; dc = dc->next)
+            wDockLower(dc->adrawer);
+    }
     for (i=0; i<dock->max_icons; i++) {
         if (dock->icon_array[i])
             wLowerFrame(dock->icon_array[i]->icon->core);
@@ -3099,11 +3299,16 @@
 wDockRaise(WDock *dock)
 {
     int i;
+    WDrawerChain *dc;
 
     for (i=dock->max_icons-1; i>=0; i--) {
         if (dock->icon_array[i])
             wRaiseFrame(dock->icon_array[i]->icon->core);
     }
+    if (dock->type == WM_DOCK) {
+        for (dc = dock->screen_ptr->drawers; dc != NULL; dc = dc->next)
+            wDockRaise(dc->adrawer);
+    }
 }
 
 
@@ -3262,10 +3467,10 @@
             WAppIconChain *chain = scr->global_icons;
 
             while (chain) {
-                moveIconBetweenDocks(chain->aicon->dock,
-                                     scr->workspaces[workspace]->clip,
-                                     chain->aicon, chain->aicon->xindex,
-                                     chain->aicon->yindex);
+                wDockMoveIconBetweenDocks(chain->aicon->dock,
+                                          scr->workspaces[workspace]->clip,
+                                          chain->aicon, chain->aicon->xindex,
+                                          chain->aicon->yindex);
                 if (scr->workspaces[workspace]->clip->collapsed)
                     XUnmapWindow(dpy, chain->aicon->icon->core->window);
                 chain = chain->next;
@@ -3343,6 +3548,7 @@
 toggleLowered(WDock *dock)
 {
     WAppIcon *tmp;
+    WDrawerChain *dc;
     int newlevel, i;
 
     /* lower/raise Dock */
@@ -3359,13 +3565,29 @@
         if (!tmp)
             continue;
 
-        ChangeStackingLevel(tmp->icon->core, newlevel);
+        /* The only case we do not want to change the stacking level
+         * is for the main tile of a drawer, that is lowered but in a
+         * "kept-on-top" dock */
+        if (!(i == 0 && dock->type == WM_DRAWER &&
+              dock->lowered && !dock->screen_ptr->dock->lowered))
+            ChangeStackingLevel(tmp->icon->core, newlevel);
+
         if (dock->lowered)
             wLowerFrame(tmp->icon->core);
     }
 
-    if (dock->type == WM_DOCK)
+    if (dock->type == WM_DOCK) {
+        for (dc = dock->screen_ptr->drawers; dc != NULL; dc = dc->next) {
+            if (dc->adrawer->lowered) {
+                ChangeStackingLevel(dc->adrawer->icon_array[ 0 ]->icon->core, newlevel);
+                if (dock->lowered)
+                    wDockLower(dc->adrawer);
+                else
+                    wDockRaise(dc->adrawer);
+            }
+        }
         wScreenUpdateUsableArea(dock->screen_ptr);
+    }
 }
 
 
@@ -3400,32 +3622,38 @@
         entry = dock->menu->entries[index];
         entry->flags.indicator_on = !dock->lowered;
         entry->clientdata = dock;
+        /* add a drawer */
+        entry = dock->menu->entries[++index];
+        entry->clientdata = aicon;
+        wMenuSetEnabled(dock->menu, index, True);
         dock->menu->flags.realized = 0;
     } else {
-        /* clip options */
+        /* clip/drawer options */
         if (scr->clip_options)
             updateClipOptionsMenu(scr->clip_options, dock);
 
         n_selected = numberOfSelectedIcons(dock);
 
-        /* Rename Workspace */
-        entry = dock->menu->entries[++index];
-        if (aicon == scr->clip_icon) {
-            entry->callback = renameCallback;
-            entry->clientdata = dock;
-            entry->flags.indicator = 0;
-            entry->text = _("Rename Workspace");
-        } else {
-            entry->callback = omnipresentCallback;
-            entry->clientdata = aicon;
-            if (n_selected > 0) {
+        if (dock->type == WM_CLIP) {
+            /* Rename Workspace */
+            entry = dock->menu->entries[++index];
+            if (aicon == scr->clip_icon) {
+                entry->callback = renameCallback;
+                entry->clientdata = dock;
                 entry->flags.indicator = 0;
-                entry->text = _("Toggle Omnipresent");
+                entry->text = _("Rename Workspace");
             } else {
-                entry->flags.indicator = 1;
-                entry->flags.indicator_on = aicon->omnipresent;
-                entry->flags.indicator_type = MI_CHECK;
-                entry->text = _("Omnipresent");
+                entry->callback = omnipresentCallback;
+                entry->clientdata = aicon;
+                if (n_selected > 0) {
+                    entry->flags.indicator = 0;
+                    entry->text = _("Toggle Omnipresent");
+                } else {
+                    entry->flags.indicator = 1;
+                    entry->flags.indicator_on = aicon->omnipresent;
+                    entry->flags.indicator_type = MI_CHECK;
+                    entry->text = _("Omnipresent");
+                }
             }
         }
 
@@ -3433,7 +3661,8 @@
         entry = dock->menu->entries[++index];
         entry->clientdata = aicon;
         entry->flags.indicator_on = aicon->icon->selected;
-        wMenuSetEnabled(dock->menu, index, aicon!=scr->clip_icon);
+        wMenuSetEnabled(dock->menu, index,
+                        aicon!=scr->clip_icon && !isADrawer(scr, aicon));
 
         /* select/unselect all icons */
         entry = dock->menu->entries[++index];
@@ -3453,15 +3682,17 @@
             entry->text = _("Keep Icon");
         wMenuSetEnabled(dock->menu, index, dock->icon_count > 1);
 
-        /* this is the workspace submenu part */
-        entry = dock->menu->entries[++index];
-        if (n_selected > 1)
-            entry->text = _("Move Icons To");
-        else
-            entry->text = _("Move Icon To");
-        if (scr->clip_submenu)
-            updateWorkspaceMenu(scr->clip_submenu, aicon);
-        wMenuSetEnabled(dock->menu, index, !aicon->omnipresent);
+        if (dock->type == WM_CLIP) {
+            /* this is the workspace submenu part */
+            entry = dock->menu->entries[++index];
+            if (n_selected > 1)
+                entry->text = _("Move Icons To");
+            else
+                entry->text = _("Move Icon To");
+            if (scr->clip_submenu)
+                updateWorkspaceMenu(scr->clip_submenu, aicon);
+            wMenuSetEnabled(dock->menu, index, !aicon->omnipresent);
+        }
 
         /* remove icon(s) */
         entry = dock->menu->entries[++index];
@@ -3518,15 +3749,23 @@
     wMenuSetEnabled(dock->menu, index, !aicon->editing
                     && !wPreferences.flags.noupdates);
 
-    /* kill */
+    /* kill or remove drawer */
     entry = dock->menu->entries[++index];
     entry->clientdata = aicon;
-    wMenuSetEnabled(dock->menu, index, appIsRunning);
+    if (isADrawer(scr, aicon)) {
+        entry->callback = removeDrawerCallback;
+        entry->text = _("Remove drawer");
+        wMenuSetEnabled(dock->menu, index, True);
+    } else {
+        entry->callback = killCallback;
+        entry->text = _("Kill");
+        wMenuSetEnabled(dock->menu, index, appIsRunning);
+    }
 
     if (!dock->menu->flags.realized)
         wMenuRealize(dock->menu);
 
-    if (dock->type == WM_CLIP) {
+    if (dock->type == WM_CLIP || dock->type == WM_DRAWER) {
         /*x_pos = event->xbutton.x_root+2;*/
         x_pos = event->xbutton.x_root - dock->menu->frame->core->width/2 - 1;
         if (x_pos < 0) {
@@ -3586,6 +3825,8 @@
                     toggleCollapsed(dock);
                 else
                     handleClipChangeWorkspace(dock->screen_ptr, event);
+	    } else if (isADrawer(dock->screen_ptr, btn)) {
+                toggleCollapsed(dock);
             } else if (btn->command) {
                 if (!btn->launching &&
                     (!btn->running || (event->xbutton.state & ControlMask))) {
@@ -3606,7 +3847,10 @@
 {
     WScreen *scr = dock->screen_ptr;
     int ofs_x=event->xbutton.x, ofs_y=event->xbutton.y;
-    int x, y;
+    Window wins[2];
+    WIcon *icon = aicon->icon;
+    int x = aicon->x_pos, y = aicon->y_pos;
+    int ix, iy, snapped, shad_x = x, shad_y = y;
     XEvent ev;
     int grabbed = 0, swapped = 0, done;
     Pixmap ghost = None;
@@ -3620,14 +3864,37 @@
                      GrabModeAsync, None, None, CurrentTime) !=GrabSuccess) {
         wwarning("pointer grab failed for dock move");
     }
-    y = 0;
-    for (x=0; x<dock->max_icons; x++) {
-        if (dock->icon_array[x]!=NULL &&
-            dock->icon_array[x]->yindex > y)
-            y = dock->icon_array[x]->yindex;
+    if (dock->type == WM_DRAWER) {
+        wins[0] = icon->core->window;
+        wins[1] = scr->dock_shadow;
+        XRestackWindows(dpy, wins, 2);
+        XMoveResizeWindow(dpy, scr->dock_shadow, aicon->x_pos, aicon->y_pos,
+                          ICON_SIZE, ICON_SIZE);
+        if (superfluous) {
+            if (icon->pixmap!=None)
+                ghost = MakeGhostIcon(scr, icon->pixmap);
+            else
+                ghost = MakeGhostIcon(scr, icon->core->window);
+
+            XSetWindowBackgroundPixmap(dpy, scr->dock_shadow, ghost);
+            XClearWindow(dpy, scr->dock_shadow);
+        }
+        XMapWindow(dpy, scr->dock_shadow);
+    } else {
+        WDrawerChain *dc;
+        y = 0;
+        for (x=0; x<dock->max_icons; x++) {
+            if (dock->icon_array[x]!=NULL &&
+                dock->icon_array[x]->yindex > y)
+                y = dock->icon_array[x]->yindex;
+        }
+        for (dc = scr->drawers; dc; dc = dc->next) {
+            if ((dc->adrawer->y_pos - dock->y_pos) / ICON_SIZE > y)
+                y = (dc->adrawer->y_pos - dock->y_pos) / ICON_SIZE;
+        }
+        y++;
+        XResizeWindow(dpy, scr->dock_shadow, ICON_SIZE, ICON_SIZE*y);
     }
-    y++;
-    XResizeWindow(dpy, scr->dock_shadow, ICON_SIZE, ICON_SIZE*y);
 
     done = 0;
     while (!done) {
@@ -3652,13 +3919,15 @@
                 }
                 break;
             }
-            if (dock->type == WM_CLIP) {
+            switch (dock->type) {
+            case WM_CLIP:
                 x = ev.xmotion.x_root - ofs_x;
                 y = ev.xmotion.y_root - ofs_y;
                 wScreenKeepInside(scr, &x, &y, ICON_SIZE, ICON_SIZE);
 
                 moveDock(dock, x, y);
-            } else {
+                break;
+            case WM_DOCK:
                 /* move vertically if pointer is inside the dock*/
                 if ((dock->on_right_side &&
                      ev.xmotion.x_root >= dock->x_pos - ICON_SIZE)
@@ -3721,7 +3990,23 @@
                         }
                     }
                 }
-            }
+                break;
+            case WM_DRAWER:
+            {
+                WDock *real_dock = dock->screen_ptr->dock;
+
+                x = ev.xmotion.x_root - ofs_x;
+                y = ev.xmotion.y_root - ofs_y;
+                snapped = wDockSnapIcon(real_dock, aicon, x, y, &ix, &iy, True);
+                if (snapped) {
+                    shad_x = real_dock->x_pos + ix*wPreferences.icon_size;
+                    shad_y = real_dock->y_pos + iy*wPreferences.icon_size;
+                    XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
+                }
+                moveDock(dock, x, y);
+                break;
+            } /* local block for real_dock in case WM_DRAWER */
+            } /* end of switch (dock->type) */
             break;
 
         case ButtonPress:
@@ -3731,7 +4016,26 @@
             if (ev.xbutton.button != event->xbutton.button)
                 break;
             XUngrabPointer(dpy, CurrentTime);
-            XUnmapWindow(dpy, scr->dock_shadow);
+            if (dock->type == WM_DRAWER) {
+                int i;
+                Window *wins[ dock->icon_count ];
+                WAppIcon *aicon;
+
+                for (i = 0; i < dock->max_icons; i++) {
+                    if ((aicon = dock->icon_array[ i ]) == NULL)
+                        continue;
+                    wins[ aicon->xindex + (dock->on_right_side ? dock->icon_count - 1 : 0) ] = &aicon->icon->core->window;
+                }
+                SlideWindows(wins, dock->icon_count,
+                               (dock->on_right_side ? x - (dock->icon_count - 1) * ICON_SIZE : x),
+                               y,
+                               (dock->on_right_side ? shad_x - (dock->icon_count - 1) * ICON_SIZE : shad_x),
+                               shad_y);
+                XUnmapWindow(dpy, scr->dock_shadow);
+                moveDock(dock, shad_x, shad_y);
+            } else {
+                XUnmapWindow(dpy, scr->dock_shadow);
+            }
             XResizeWindow(dpy, scr->dock_shadow, ICON_SIZE, ICON_SIZE);
             if (dock->type == WM_DOCK) {
                 if (swapped!=0) {
@@ -3758,283 +4062,53 @@
 }
 
 
-
-static void
-handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
+static int
+getClipButton(int px, int py)
 {
-    WScreen *scr = dock->screen_ptr;
-    Window wins[2];
-    WIcon *icon = aicon->icon;
-    WDock *dock2 = NULL, *last_dock = dock, *clip = NULL;
-    int ondock, grabbed = 0, change_dock = 0, collapsed = 0;
-    XEvent ev;
-    int x = aicon->x_pos, y = aicon->y_pos;
-    int ofs_x = event->xbutton.x, ofs_y = event->xbutton.y;
-    int shad_x = x, shad_y = y;
-    int ix = aicon->xindex, iy = aicon->yindex;
-    int tmp;
-    Pixmap ghost = None;
-    Bool docked;
-    int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
-    int omnipresent = aicon->omnipresent; /* this must be cached!!! */
-    Bool shown_clip_icons = False;
-
-
-    if (wPreferences.flags.noupdates)
-        return;
+    int pt = (CLIP_BUTTON_SIZE+2)*ICON_SIZE/64;
 
-    if (XGrabPointer(dpy, icon->core->window, True, ButtonMotionMask
-                     |ButtonReleaseMask|ButtonPressMask, GrabModeAsync,
-                     GrabModeAsync, None, None, CurrentTime) !=GrabSuccess) {
-#ifdef DEBUG0
-        wwarning("pointer grab failed for icon move");
-#endif
-    }
+    if (px < 0 || py < 0 || px >= ICON_SIZE || py >= ICON_SIZE)
+        return CLIP_IDLE;
 
-    if (!(event->xbutton.state & MOD_MASK))
-        wRaiseFrame(icon->core);
+    if (py <= pt-((int)ICON_SIZE-1-px))
+        return CLIP_FORWARD;
+    else if (px <= pt-((int)ICON_SIZE-1-py))
+        return CLIP_REWIND;
 
-    if (!wPreferences.flags.noclip)
-        clip = scr->workspaces[scr->current_workspace]->clip;
+    return CLIP_IDLE;
+}
 
-    if (dock == scr->dock && !wPreferences.flags.noclip)
-        dock2 = clip;
-    else if (dock != scr->dock && !wPreferences.flags.nodock)
-        dock2 = scr->dock;
-
-    wins[0] = icon->core->window;
-    wins[1] = scr->dock_shadow;
-    XRestackWindows(dpy, wins, 2);
-    XMoveResizeWindow(dpy, scr->dock_shadow, aicon->x_pos, aicon->y_pos,
-                      ICON_SIZE, ICON_SIZE);
-    if (superfluous) {
-        if (icon->pixmap!=None)
-            ghost = MakeGhostIcon(scr, icon->pixmap);
-        else
-            ghost = MakeGhostIcon(scr, icon->core->window);
 
-        XSetWindowBackgroundPixmap(dpy, scr->dock_shadow, ghost);
-        XClearWindow(dpy, scr->dock_shadow);
-    }
-    XMapWindow(dpy, scr->dock_shadow);
+static void
+handleClipChangeWorkspace(WScreen *scr, XEvent *event)
+{
+    XEvent ev;
+    int done, direction, new_ws;
+    int new_dir;
+    WDock *clip = scr->clip_icon->dock;
 
-    ondock = 1;
+    direction = getClipButton(event->xbutton.x, event->xbutton.y);
 
+    clip->lclip_button_pushed = direction==CLIP_REWIND;
+    clip->rclip_button_pushed = direction==CLIP_FORWARD;
 
-    while(1) {
-        XMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
-                   |ButtonMotionMask|ExposureMask, &ev);
+    wClipIconPaint(scr->clip_icon);
+    done = 0;
+    while(!done) {
+        WMMaskEvent(dpy, ExposureMask|ButtonMotionMask|ButtonReleaseMask
+                    |ButtonPressMask, &ev);
         switch (ev.type) {
         case Expose:
             WMHandleEvent(&ev);
             break;
 
         case MotionNotify:
-            if (!grabbed) {
-                if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
-                    || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
-                    XChangeActivePointerGrab(dpy, ButtonMotionMask
-                                             |ButtonReleaseMask|ButtonPressMask,
-                                             wCursor[WCUR_MOVE], CurrentTime);
-                    grabbed=1;
-                } else {
-                    break;
-                }
-            }
-
-            if (omnipresent && !shown_clip_icons) {
-                int i;
-                for (i=0; i<scr->workspace_count; i++) {
-                    if (i == scr->current_workspace)
-                        continue;
-                    wDockShowIcons(scr->workspaces[i]->clip);
-                    /* Pb: if dock is collapsed (for instance, because
-                       it auto-collapses), its icons won't be shown. */
-                }
-                shown_clip_icons = True; /* avoid flickering */
-            }
-
-            x = ev.xmotion.x_root - ofs_x;
-            y = ev.xmotion.y_root - ofs_y;
-            tmp = wDockSnapIcon(dock, aicon, x, y, &ix, &iy, True);
-            if (tmp && dock2) {
-                change_dock = 0;
-                if (last_dock != dock && collapsed) {
-                    last_dock->collapsed = 1;
-                    wDockHideIcons(last_dock);
-                    collapsed = 0;
-                }
-                if (!collapsed && (collapsed = dock->collapsed)) {
-                    dock->collapsed = 0;
-                    wDockShowIcons(dock);
-                }
-                if (dock->auto_raise_lower)
-                    wDockRaise(dock);
-                last_dock = dock;
-            } else if (dock2) {
-                tmp = wDockSnapIcon(dock2, aicon, x, y, &ix, &iy, False);
-                if (tmp) {
-                    change_dock = 1;
-                    if (last_dock != dock2 && collapsed) {
-                        last_dock->collapsed = 1;
-                        wDockHideIcons(last_dock);
-                        collapsed = 0;
-                    }
-                    if (!collapsed && (collapsed = dock2->collapsed)) {
-                        dock2->collapsed = 0;
-                        wDockShowIcons(dock2);
-                    }
-                    if (dock2->auto_raise_lower)
-                        wDockRaise(dock2);
-                    last_dock = dock2;
-                }
-            }
-            if (aicon->launching
-                || aicon->lock
-                || (aicon->running && !(ev.xmotion.state & MOD_MASK))
-                || (!aicon->running && tmp)) {
-                shad_x = last_dock->x_pos + ix*wPreferences.icon_size;
-                shad_y = last_dock->y_pos + iy*wPreferences.icon_size;
-
-                XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
-
-                if (!ondock) {
-                    XMapWindow(dpy, scr->dock_shadow);
-                }
-                ondock = 1;
-            } else {
-                if (ondock) {
-                    XUnmapWindow(dpy, scr->dock_shadow);
-                }
-                ondock = 0;
-            }
-            XMoveWindow(dpy, icon->core->window, x, y);
-            break;
-
-        case ButtonPress:
-            break;
-
-        case ButtonRelease:
-            if (ev.xbutton.button != event->xbutton.button)
-                break;
-            XUngrabPointer(dpy, CurrentTime);
-            if (ondock) {
-                SlideWindow(icon->core->window, x, y, shad_x, shad_y);
-                XUnmapWindow(dpy, scr->dock_shadow);
-                if (!change_dock) {
-                    reattachIcon(dock, aicon, ix, iy);
-                    if (clip && dock!=clip && clip->auto_raise_lower)
-                        wDockLower(clip);
-                } else {
-                    docked = moveIconBetweenDocks(dock, dock2, aicon, ix, iy);
-                    if (!docked) {
-                        /* Slide it back if dock rejected it */
-                        SlideWindow(icon->core->window, x, y, aicon->x_pos,
-                                    aicon->y_pos);
-                        reattachIcon(dock, aicon, aicon->xindex,aicon->yindex);
-                    }
-                    if (last_dock->type==WM_CLIP && last_dock->auto_collapse) {
-                        collapsed = 0;
-                    }
-                }
-            } else {
-                aicon->x_pos = x;
-                aicon->y_pos = y;
-                if (superfluous) {
-                    if (!aicon->running && !wPreferences.no_animations) {
-                        /* We need to deselect it, even if is deselected in
-                         * wDockDetach(), because else DoKaboom() will fail.
-                         */
-                        if (aicon->icon->selected)
-                            wIconSelect(aicon->icon);
-
-                        wSoundPlay(WSOUND_KABOOM);
-                        DoKaboom(scr,aicon->icon->core->window, x, y);
-                    } else {
-                        wSoundPlay(WSOUND_UNDOCK);
-                    }
-                } else {
-                    wSoundPlay(WSOUND_UNDOCK);
-                }
-                if (clip && clip->auto_raise_lower)
-                    wDockLower(clip);
-                wDockDetach(dock, aicon);
-            }
-            if (collapsed) {
-                last_dock->collapsed = 1;
-                wDockHideIcons(last_dock);
-                collapsed = 0;
-            }
-            if (superfluous) {
-                if (ghost!=None)
-                    XFreePixmap(dpy, ghost);
-                XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
-            }
-            if (shown_clip_icons) {
-                int i;
-                for (i=0; i<scr->workspace_count; i++) {
-                    if (i == scr->current_workspace)
-                        continue;
-                    wDockHideIcons(scr->workspaces[i]->clip);
-                }
-            }
-
-#ifdef DEBUG
-            puts("End icon move");
-#endif
-            return;
-        }
-    }
-}
-
-
-static int
-getClipButton(int px, int py)
-{
-    int pt = (CLIP_BUTTON_SIZE+2)*ICON_SIZE/64;
-
-    if (px < 0 || py < 0 || px >= ICON_SIZE || py >= ICON_SIZE)
-        return CLIP_IDLE;
-
-    if (py <= pt-((int)ICON_SIZE-1-px))
-        return CLIP_FORWARD;
-    else if (px <= pt-((int)ICON_SIZE-1-py))
-        return CLIP_REWIND;
-
-    return CLIP_IDLE;
-}
-
-
-static void
-handleClipChangeWorkspace(WScreen *scr, XEvent *event)
-{
-    XEvent ev;
-    int done, direction, new_ws;
-    int new_dir;
-    WDock *clip = scr->clip_icon->dock;
-
-    direction = getClipButton(event->xbutton.x, event->xbutton.y);
-
-    clip->lclip_button_pushed = direction==CLIP_REWIND;
-    clip->rclip_button_pushed = direction==CLIP_FORWARD;
-
-    wClipIconPaint(scr->clip_icon);
-    done = 0;
-    while(!done) {
-        WMMaskEvent(dpy, ExposureMask|ButtonMotionMask|ButtonReleaseMask
-                    |ButtonPressMask, &ev);
-        switch (ev.type) {
-        case Expose:
-            WMHandleEvent(&ev);
-            break;
-
-        case MotionNotify:
-            new_dir = getClipButton(ev.xmotion.x, ev.xmotion.y);
-            if (new_dir != direction) {
-                direction = new_dir;
-                clip->lclip_button_pushed = direction==CLIP_REWIND;
-                clip->rclip_button_pushed = direction==CLIP_FORWARD;
-                wClipIconPaint(scr->clip_icon);
+            new_dir = getClipButton(ev.xmotion.x, ev.xmotion.y);
+            if (new_dir != direction) {
+                direction = new_dir;
+                clip->lclip_button_pushed = direction==CLIP_REWIND;
+                clip->rclip_button_pushed = direction==CLIP_FORWARD;
+                wClipIconPaint(scr->clip_icon);
             }
             break;
 
@@ -4122,7 +4196,7 @@
             else
                 handleDockMove(dock, aicon, event);
         } else
-            handleIconMove(dock, aicon, event);
+            wHandleAppIconMove(aicon, event);
 
     } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
                aicon==scr->clip_icon) {
@@ -4229,7 +4303,7 @@
     scr = btn->icon->core->screen_ptr;
     dock = btn->dock;
 
-    if (!dock || dock->type!=WM_CLIP)
+    if (!dock || (dock->type != WM_CLIP && dock->type != WM_DRAWER))
         return;
 
     /* The auto raise/lower code */
@@ -4254,12 +4328,14 @@
                                                     (void *)dock);
     }
 
-    if (btn->xindex == 0 && btn->yindex == 0)
-        showClipBalloon(dock, dock->screen_ptr->current_workspace);
-    else {
-        if (dock->screen_ptr->flags.clip_balloon_mapped) {
-            XUnmapWindow(dpy, dock->screen_ptr->clip_balloon);
-            dock->screen_ptr->flags.clip_balloon_mapped = 0;
+    if (dock->type == WM_CLIP) {
+        if (btn->xindex == 0 && btn->yindex == 0)
+            showClipBalloon(dock, dock->screen_ptr->current_workspace);
+        else {
+            if (dock->screen_ptr->flags.clip_balloon_mapped) {
+                XUnmapWindow(dpy, dock->screen_ptr->clip_balloon);
+                dock->screen_ptr->flags.clip_balloon_mapped = 0;
+            }
         }
     }
 }
@@ -4271,16 +4347,15 @@
     XEvent event;
     WObjDescriptor *desc = NULL;
 
-    if (!dock || dock->type!=WM_CLIP)
+    if (!dock || (dock->type != WM_CLIP && dock->type != WM_DRAWER))
         return;
 
     if (XCheckTypedEvent(dpy, EnterNotify, &event)!=False) {
         if (XFindContext(dpy, event.xcrossing.window, wWinContext,
                          (XPointer *)&desc)!=XCNOENT
             && desc && desc->parent_type==WCLASS_DOCK_ICON
-            && ((WAppIcon*)desc->parent)->dock
-            && ((WAppIcon*)desc->parent)->dock->type==WM_CLIP) {
-            /* We didn't left the Clip yet */
+            && ((WAppIcon*)desc->parent)->dock == dock) {
+            /* We haven't left the Clip/Drawer yet */
             XPutBackEvent(dpy, &event);
             return;
         }
@@ -4332,7 +4407,7 @@
 {
     WDock *dock = (WDock *)cdata;
 
-    if (dock->type!=WM_CLIP)
+    if (dock->type != WM_CLIP && dock->type != WM_DRAWER)
         return;
 
     if (dock->auto_collapse) {
@@ -4348,7 +4423,7 @@
 {
     WDock *dock = (WDock *)cdata;
 
-    if (dock->type!=WM_CLIP)
+    if (dock->type != WM_CLIP && dock->type != WM_DRAWER)
         return;
 
     if (dock->auto_collapse) {
@@ -4364,7 +4439,7 @@
 {
     WDock *dock = (WDock *)cdata;
 
-    if (dock->type!=WM_CLIP)
+    if (dock->type != WM_CLIP && dock->type != WM_DRAWER)
         return;
 
     if (dock->auto_raise_lower)
@@ -4379,7 +4454,7 @@
 {
     WDock *dock = (WDock *)cdata;
 
-    if (dock->type!=WM_CLIP)
+    if (dock->type != WM_CLIP && dock->type != WM_DRAWER)
         return;
 
     if (dock->auto_raise_lower)
@@ -4474,3 +4549,677 @@
     return status;
 }
 
+
+static void
+drawerAppendToChain(WScreen *scr, WDock *drawer)
+{
+    WDrawerChain **where_to_add;
+
+    where_to_add = &scr->drawers;
+    while ((*where_to_add) != NULL) {
+        where_to_add = &(*where_to_add)->next;
+    }
+
+    *where_to_add = wmalloc(sizeof(WDrawerChain));
+    (*where_to_add)->adrawer = drawer;
+    (*where_to_add)->next = NULL;
+    scr->drawer_count++;
+}
+
+
+static void
+drawerRemoveFromChain(WScreen *scr, WDock *drawer)
+{
+    WDrawerChain *next, **to_remove;
+
+    to_remove = &scr->drawers;
+    while (True) {
+        if (*to_remove == NULL) {
+            wwarning("The drawer to be removed can not be found.");
+            return;
+        }
+        if ((*to_remove)->adrawer == drawer)
+            break;
+
+        to_remove = &(*to_remove)->next;
+    }
+    next = (*to_remove)->next;
+    wfree(*to_remove);
+    *to_remove = next;
+    scr->drawer_count--;
+}
+
+
+/* Don't free the returned string. Duplicate it. */
+static char *
+findUniqueName(WScreen *scr, char *instance_basename)
+{
+    static char buffer[128];
+    WDrawerChain *dc;
+    int i;
+    int already_in_use = True;
+
+#define UNIQUE_NAME_WATCHDOG 128
+    for (i = 0; already_in_use && i < UNIQUE_NAME_WATCHDOG; i++) {
+        snprintf(buffer, sizeof buffer, "%s%d", instance_basename, i);
+
+        already_in_use = False;
+
+        for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+            if (!strncmp(dc->adrawer->icon_array[0]->wm_instance, buffer,
+                         sizeof buffer)) {
+                already_in_use = True;
+                break;
+            }
+        }
+    }
+
+    if (i == UNIQUE_NAME_WATCHDOG)
+        wwarning("Couldn't find a unique name for drawer in %d attemps.", i);
+#undef UNIQUE_NAME_WATCHDOG
+
+    return buffer;
+}
+
+
+static void
+drawerIconExpose(WObjDescriptor *desc, XEvent *event)
+{
+    wDrawerIconPaint((WAppIcon *) desc->parent);
+}
+
+
+static int
+addADrawer(WScreen *scr)
+{
+    int i, y;
+    WDock *drawer, *dock = scr->dock;
+    WDrawerChain *dc;
+    char can_be_here[dock->max_icons];
+
+    if (dock->icon_count + scr->drawer_count >= dock->max_icons)
+        return -1;
+
+    for (y = 0; y < dock->max_icons; y++) {
+        can_be_here[ y ] = True;
+    }
+    for (i = 0; i < dock->max_icons; i++) {
+        if (dock->icon_array[ i ] != NULL)
+            can_be_here[ dock->icon_array[i]->yindex ] = False;
+    }
+    for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+        y = (int) ((dc->adrawer->y_pos - dock->y_pos) / ICON_SIZE);
+        can_be_here[ y ] = False;
+    }
+
+    for (y = 0; y < dock->max_icons; y++) {
+        if (can_be_here[ y ])
+            break;
+    }
+
+    drawer = wDockCreate(scr, WM_DRAWER, NULL);
+
+    drawer->x_pos = dock->x_pos;
+    drawer->y_pos = dock->y_pos + ICON_SIZE * y;
+    drawer->icon_array[0]->xindex = 0;
+    drawer->icon_array[0]->yindex = 0;
+    drawer->icon_array[0]->x_pos = drawer->x_pos;
+    drawer->icon_array[0]->y_pos = drawer->y_pos;
+    XMoveWindow(dpy, drawer->icon_array[0]->icon->core->window,
+                drawer->icon_array[0]->x_pos, drawer->icon_array[0]->y_pos = drawer->y_pos);
+
+    return 0;
+}
+
+
+static void
+addADrawerCallback(WMenu *menu, WMenuEntry *entry)
+{
+    assert(entry->clientdata!=NULL);
+    addADrawer(((WAppIcon *) entry->clientdata)->dock->screen_ptr);
+}
+
+
+static void
+drawerDestroy(WDock *drawer)
+{
+    WScreen *scr;
+    int i;
+    WAppIcon *aicon;
+    WMArray *icons;
+
+    if (drawer == NULL)
+        return;
+
+    scr = drawer->screen_ptr;
+
+#if 0 /* Actually, we can't delete any dock/clip/drawer menu, because
+       * that would (try to) wfree some memory in gettext library (see
+       * menu entries that have several "versions", such like "Hide"
+       * and "Unhide"). */
+    if (scr->drawer_count == 1) { /* last drawer */
+        wMenuDestroy(drawer->menu, False);
+        scr->drawer_menu = NULL;
+    }
+#endif
+    wDefaultPurgeInfo(scr, drawer->icon_array[0]->wm_instance,
+                      drawer->icon_array[0]->wm_class);
+    icons = WMCreateArray(drawer->icon_count - 1);
+    for (i = 1; i < drawer->max_icons; i++) {
+        if (!(aicon = drawer->icon_array[ i ]))
+            continue;
+        WMAddToArray(icons, aicon);
+    }
+    removeIcons(icons, drawer);
+
+    if (drawer->auto_collapse_magic) {
+        WMDeleteTimerHandler(drawer->auto_collapse_magic);
+        drawer->auto_collapse_magic = NULL;
+    }
+    if (drawer->auto_lower_magic) {
+        WMDeleteTimerHandler(drawer->auto_lower_magic);
+        drawer->auto_lower_magic = NULL;
+    }
+
+    wAppIconDestroy(drawer->icon_array[0]);
+    wfree(drawer->icon_array);
+    wfree(drawer);
+
+    drawerRemoveFromChain(scr, drawer);
+    if (scr->last_dock == drawer)
+        scr->last_dock = NULL;
+    if (scr->attracting_drawer == drawer)
+        scr->attracting_drawer = NULL;
+}
+
+
+static void
+removeDrawerCallback(WMenu *menu, WMenuEntry *entry)
+{
+    WDock *dock = ((WAppIcon*)entry->clientdata)->dock;
+    assert(dock != NULL);
+
+    if (dock->icon_count > 1) {
+        if (wMessageDialog(dock->screen_ptr, _("Drawer"),
+                           _("All icons in this drawer will be detached!"),
+                           _("OK"), _("Cancel"), NULL)!=WAPRDefault)
+            return;
+    }
+    drawerDestroy(dock);
+}
+
+
+void
+wDrawerIconPaint(WAppIcon *dicon)
+{
+    Window win = dicon->icon->core->window;
+    WScreen *scr = dicon->icon->core->screen_ptr;
+    XPoint p[4];
+    GC gc = scr->draw_gc;
+    WMColor *color;
+
+    wIconPaint(dicon->icon);
+
+    if (!dicon->dock->collapsed)
+        color = scr->clip_title_color[CLIP_NORMAL];
+    else
+        color = scr->clip_title_color[CLIP_COLLAPSED];
+    XSetForeground(dpy, gc, WMColorPixel(color));
+
+    if (dicon->dock->on_right_side) {
+        p[0].x = p[3].x = 10;
+        p[0].y = p[3].y = ICON_SIZE / 2 - 5;
+        p[1].x = 10;
+        p[1].y = ICON_SIZE / 2 + 5;
+        p[2].x = 5;
+        p[2].y = ICON_SIZE / 2;
+    } else {
+        p[0].x = p[3].x = ICON_SIZE-1 - 10;
+        p[0].y = p[3].y = ICON_SIZE / 2 - 5;
+        p[1].x = ICON_SIZE-1 - 10;
+        p[1].y = ICON_SIZE / 2 + 5;
+        p[2].x = ICON_SIZE-1 - 5;
+        p[2].y = ICON_SIZE / 2;
+    }
+    XFillPolygon(dpy, win, gc, p,3,Convex,CoordModeOrigin);
+    XDrawLines(dpy, win, gc, p,4,CoordModeOrigin);
+}
+
+
+RImage*
+wDrawerMakeTile(WScreen *scr, RImage *normalTile)
+{
+    RImage *tile = RCloneImage(normalTile);
+    RColor dark;
+    RColor light;
+
+    dark.alpha = 0;
+    dark.red = dark.green = dark.blue = 60;
+
+    light.alpha = 0;
+    light.red = light.green = light.blue = 80;
+
+    /* arrow bevel */
+    if (!scr->dock || scr->dock->on_right_side)
+    {
+        ROperateLine(tile, RSubtractOperation, 11, ICON_SIZE / 2 - 7,
+                     4, ICON_SIZE / 2, &dark);       /* / */
+        ROperateLine(tile, RSubtractOperation, 11, ICON_SIZE / 2 + 7,
+                     4, ICON_SIZE / 2, &dark);       /* \ */
+        ROperateLine(tile, RAddOperation,      11, ICON_SIZE / 2 - 7,
+                     11, ICON_SIZE / 2 + 7, &light); /* | */
+    }
+    else
+    {
+        ROperateLine(tile, RSubtractOperation, ICON_SIZE-1 - 11, ICON_SIZE / 2 - 7,
+                     ICON_SIZE-1 - 4, ICON_SIZE / 2, &dark);      /* \ */
+        ROperateLine(tile, RAddOperation,      ICON_SIZE-1 - 11, ICON_SIZE / 2 + 7,
+                     ICON_SIZE-1 - 4, ICON_SIZE / 2, &light);     /* / */
+        ROperateLine(tile, RSubtractOperation, ICON_SIZE-1 - 11, ICON_SIZE / 2 - 7,
+                     ICON_SIZE-1 - 11, ICON_SIZE / 2 + 7, &dark); /* | */
+    }
+    return tile;
+}
+
+
+static void
+swapDrawer(WDock *drawer, int new_x)
+{
+    int i;
+
+    drawer->on_right_side = !drawer->on_right_side;
+    drawer->x_pos = new_x;
+
+    for (i = 0; i < drawer->max_icons; i++) {
+        WAppIcon *ai;
+        if ((ai = drawer->icon_array[ i ]) == NULL)
+            continue;
+        ai->xindex *= -1; /* so A B C becomes C B A */
+        ai->x_pos = new_x + ai->xindex * ICON_SIZE;
+
+        /* Update drawer's tile */
+        if (i == 0) {
+            wIconUpdate(ai->icon);
+            wDrawerIconPaint(ai);
+        }
+        XMoveWindow(dpy, ai->icon->core->window, ai->x_pos, ai->y_pos);
+    }
+}
+
+
+static void
+swapDrawers(WScreen *scr, int on_right_side, int new_x)
+{
+    WDrawerChain *dc;
+
+    if (scr->drawer_tile) {
+        RReleaseImage(scr->drawer_tile);
+    }
+    scr->drawer_tile = wDrawerMakeTile(scr, scr->icon_tile);
+
+    for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+        swapDrawer(dc->adrawer, new_x);
+        assert(dc->adrawer->on_right_side == on_right_side);
+    }
+}
+
+
+static int
+isADrawer(WScreen *scr, WAppIcon *aicon)
+{
+    return aicon && aicon->dock &&
+        aicon->dock->type == WM_DRAWER && aicon->dock->icon_array[ 0 ] == aicon;
+}
+
+
+static WDock*
+getDrawer(WScreen *scr, int y_index)
+{
+    WDrawerChain *dc;
+
+    for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+        if (dc->adrawer->y_pos - scr->dock->y_pos == y_index * ICON_SIZE)
+            return dc->adrawer;
+    }
+    return NULL;
+}
+
+
+
+/* Find the "hole" a moving appicon created when snapped into the
+ * drawer. redocking is a boolean. If the moving appicon comes from the
+ * drawer, drawer->icon_count is correct. If not, redocking is then false and
+ * there are now drawer->icon_count plus one appicons in the drawer. */
+static int
+indexOfHole(WDock *drawer, WAppIcon *moving_aicon, int redocking)
+{
+    int index_of_hole, i;
+
+    /* /!\ That 's a (pretty clever) kludge. ;-)
+     *
+     * We have n-1 (n = drawer->icon_count-1 or drawer->icon_count, see
+     * redocking) appicons, whose xindex are unique in [1..n]. One is missing:
+     * that's where the ghost of the moving appicon is, that's what the
+     * function should return.
+     *
+     * We compute 1+2+...+n (this sum is equal to n*(n+1)/2), we substract to
+     * this sum the xindex of each of the n-1 appicons, and we get the correct
+     * index ! */
+
+    if (redocking) {
+        index_of_hole = (drawer->icon_count-1) * drawer->icon_count / 2;
+    } else {
+        index_of_hole = drawer->icon_count * (drawer->icon_count+1) / 2;
+    }
+    index_of_hole *= (drawer->on_right_side ? -1 : 1);
+
+    for (i = 1; i < drawer->max_icons; i++) {
+        if (drawer->icon_array[i] && drawer->icon_array[i] != moving_aicon)
+            index_of_hole -= drawer->icon_array[ i ]->xindex;
+    }
+    /* wmessage(" Index of the moving appicon is %d (%sredocking)", index_of_hole, (redocking ? "" : "not ")); */
+    if (abs(index_of_hole) > abs(drawer->icon_count) - (redocking?1:0))
+        wwarning(" index_of_hole is too large ! (%d greater than %d)",
+                 index_of_hole, abs(drawer->icon_count) - (redocking?1:0));
+    if (index_of_hole == 0)
+        wwarning(" index_of_hole == 0 (%sredocking, icon_count == %d)", (redocking ? "" : "not "), drawer->icon_count);
+
+    return index_of_hole;
+}
+
+
+void
+wSlideAppicons(WAppIcon **appicons, int n, int to_the_left)
+{
+    int i;
+    int leftmost, min_index = 9999, from_x;
+    Window *wins[n]; /* to be "cleaned" ;-) */
+    WAppIcon *aicon;
+
+    if (n < 1)
+        return;
+
+    for (i = 0; i < n; i++) {
+        aicon = appicons[ i ];
+        aicon->xindex += (to_the_left ? -1 : +1);
+        if (aicon->xindex < min_index) {
+            min_index = aicon->xindex;
+            leftmost = i;
+            from_x = aicon->x_pos;
+        }
+        aicon->x_pos += (to_the_left ? -ICON_SIZE : +ICON_SIZE);
+    }
+
+    for (i = 0; i < n; i++) {
+        aicon = appicons[ i ];
+        wins[aicon->xindex - min_index] = &aicon->icon->core->window;
+    }
+    aicon = appicons[ leftmost ];
+    SlideWindows(wins, n, from_x, aicon->y_pos, aicon->x_pos, aicon->y_pos);
+}
+
+
+void
+wDrawerFillTheGap(WDock *drawer, WAppIcon *aicon, Bool redocking)
+{
+    int i, j;
+    int index_of_hole = indexOfHole(drawer, aicon, redocking);
+    WAppIcon *aicons_to_shift[ drawer->icon_count ]; /* to be "cleaned" ;-) */
+
+    j = 0;
+    for (i = 0; i < drawer->max_icons; i++) {
+        WAppIcon *ai = drawer->icon_array[ i ];
+        if (ai && ai != aicon &&
+            abs(ai->xindex) > abs(index_of_hole))
+            aicons_to_shift[ j++ ] = ai;
+    }
+    if (j != drawer->icon_count - abs(index_of_hole) - (redocking ? 1 : 0))
+        wwarning("Removing aicon at index %d from %s: j=%d but should be %d",
+                 index_of_hole, drawer->icon_array[0]->wm_instance,
+                 j, drawer->icon_count - abs(index_of_hole) - (redocking ? 1 : 0));
+    wSlideAppicons(aicons_to_shift, j, !drawer->on_right_side);
+}
+
+
+/* similar to wDockRestoreState, but a lot a specific stuff too... */
+static WDock *
+drawerRestoreState(WScreen *scr, WMPropList *drawer_state)
+{
+    WDock *drawer;
+    WMPropList *apps, *value, *dock_state;
+    WAppIcon *aicon, *old_top;
+    int count, i;
+
+    if (!drawer_state)
+        return NULL;
+
+    make_keys();
+
+    WMRetainPropList(drawer_state);
+
+    /* Get the instance name, and create a drawer */
+    value = WMGetFromPLDictionary(drawer_state, dName);
+    drawer = wDockCreate(scr, WM_DRAWER, WMGetFromPLString(value));
+
+    /* restore DnD command and paste command */
+#ifdef XDND
+    value = WMGetFromPLDictionary(drawer_state, dDropCommand);
+    if (value && WMIsPLString(value))
+	drawer->icon_array[0]->dnd_command = wstrdup(WMGetFromPLString(value));
+#endif /* XDND */
+
+    value = WMGetFromPLDictionary(drawer_state, dPasteCommand);
+    if (value && WMIsPLString(value))
+	drawer->icon_array[0]->paste_command = wstrdup(WMGetFromPLString(value));
+
+    /* restore position */
+    value = WMGetFromPLDictionary(drawer_state, dPosition);
+    if (!value || !WMIsPLString(value))
+        COMPLAIN("Position");
+    else {
+        int x, y, y_index;
+        if (sscanf(WMGetFromPLString(value), "%i,%i", &x, &y) != 2)
+            COMPLAIN("Position");
+
+        /* check position sanity */
+        if (x != scr->dock->x_pos) {
+            x = scr->dock->x_pos;
+        }
+        y_index = (y - scr->dock->y_pos) / ICON_SIZE;
+        if (y_index <= 0) {
+            y_index = 1;
+        }
+        if (y_index >= scr->dock->max_icons) {
+            /* Here we should do something more intelligent, since it
+             * can happen even if the user hasn't hand-edited his
+             * G/D/State file (but uses a lower resolution). */
+            y_index = scr->dock->max_icons - 1;
+        }
+        y = scr->dock->y_pos + y_index * ICON_SIZE;
+        moveDock(drawer, x, y);
+    }
+
+    /* restore dock properties (applist and others) */
+    dock_state = WMGetFromPLDictionary(drawer_state, dDock);
+
+    /* restore lowered/raised state */
+    drawer->lowered = 0;
+    value = WMGetFromPLDictionary(dock_state, dLowered);
+    if (value && strcasecmp(WMGetFromPLString(value), "YES") ==0) {
+        drawer->lowered = 1;
+    }
+    if (!drawer->lowered || !scr->dock->lowered)
+        ChangeStackingLevel(drawer->icon_array[ 0 ]->icon->core, WMDockLevel);
+    else
+        ChangeStackingLevel(drawer->icon_array[ 0 ]->icon->core, WMNormalLevel);
+    wRaiseFrame(drawer->icon_array[ 0 ]->icon->core);
+
+    /* restore collapsed state */
+    drawer->collapsed = 0;
+    value = WMGetFromPLDictionary(dock_state, dCollapsed);
+    if (value && strcasecmp(WMGetFromPLString(value), "YES") ==0) {
+        drawer->collapsed = 1;
+    }
+    /* restore auto-collapsed state */
+    value = WMGetFromPLDictionary(dock_state, dAutoCollapse);
+    if (value && strcasecmp(WMGetFromPLString(value), "YES") ==0) {
+        drawer->auto_collapse = 1;
+        drawer->collapsed = 1;
+    }
+    /* restore auto-raise/lower state */
+    value = WMGetFromPLDictionary(dock_state, dAutoRaiseLower);
+    if (value && strcasecmp(WMGetFromPLString(value), "YES") ==0) {
+        drawer->auto_raise_lower = 1;
+    }
+    /* restore attract icons state */
+    drawer->attract_icons = 0;
+    value = WMGetFromPLDictionary(dock_state, dAutoAttractIcons);
+    if (value && strcasecmp(WMGetFromPLString(value), "YES") ==0) {
+        drawer->attract_icons = 1;
+        scr->attracting_drawer = drawer;
+    }
+
+    /* application list */
+    apps = WMGetFromPLDictionary(dock_state, dApplications);
+
+    if (!apps) {
+        goto finish;
+    }
+
+    count = WMGetPropListItemCount(apps);
+
+    if (count==0)
+        goto finish;
+
+    old_top = drawer->icon_array[0];
+
+    for (i=0; i<count; i++) {
+        if (drawer->icon_count >= drawer->max_icons) {
+            wwarning(_("there are too many icons stored in drawer. Ignoring what doesn't fit"));
+            break;
+        }
+
+        value = WMGetFromPLArray(apps, i);
+        aicon = restore_icon_state(scr, value, WM_DRAWER, drawer->icon_count);
+
+        drawer->icon_array[drawer->icon_count] = aicon;
+
+        if (aicon) {
+            aicon->dock = drawer;
+            aicon->x_pos = drawer->x_pos + (aicon->xindex*ICON_SIZE);
+            aicon->y_pos = drawer->y_pos + (aicon->yindex*ICON_SIZE);
+
+            if (!drawer->lowered)
+                ChangeStackingLevel(aicon->icon->core, WMDockLevel);
+            else
+                ChangeStackingLevel(aicon->icon->core, WMNormalLevel);
+
+            wCoreConfigure(aicon->icon->core, aicon->x_pos, aicon->y_pos,
+                           0, 0);
+
+            if (!drawer->collapsed)
+                XMapWindow(dpy, aicon->icon->core->window);
+            wRaiseFrame(aicon->icon->core);
+
+            drawer->icon_count++;
+        }
+    }
+
+finish:
+    WMReleasePropList(drawer_state);
+
+    return drawer;
+}
+
+
+/* Same kind of comment than for previous function: this function is
+ * very similar to make_icon_state, but has substential differences as
+ * well. */
+static WMPropList *
+drawerSaveState(WScreen *scr, WDock *drawer)
+{
+    WMPropList *pstr, *drawer_state;
+    WAppIcon *ai;
+    char buffer[ 64 ];
+
+    ai = drawer->icon_array[ 0 ];
+    /* Store its name */
+    pstr = WMCreatePLString(ai->wm_instance);
+    drawer_state = WMCreatePLDictionary(dName, pstr, NULL); /* we need this final NULL */
+    WMReleasePropList(pstr);
+
+    /* Store its position */
+    snprintf(buffer, sizeof(buffer), "%hi,%hi", ai->x_pos, ai->y_pos);
+    pstr = WMCreatePLString(buffer);
+    WMPutInPLDictionary(drawer_state, dPosition, pstr);
+    WMReleasePropList(pstr);
+
+#ifdef XDND
+    /* Store its DnD command */
+    if (ai->dnd_command) {
+        pstr = WMCreatePLString(ai->dnd_command);
+        WMPutInPLDictionary(drawer_state, dDropCommand, pstr);
+        WMReleasePropList(pstr);
+    }
+#endif /* XDND */
+
+    /* Store its paste command */
+    if (ai->paste_command) {
+        pstr = WMCreatePLString(ai->paste_command);
+        WMPutInPLDictionary(drawer_state, dPasteCommand, pstr);
+        WMReleasePropList(pstr);
+    }
+
+    /* Store applications list and other properties */
+    pstr = dockSaveState(drawer);
+    WMPutInPLDictionary(drawer_state, dDock, pstr);
+    WMReleasePropList(pstr);
+
+    return drawer_state;
+}
+
+
+void
+wDrawersSaveState(WScreen *scr, WMPropList *old_state)
+{
+    WMPropList *all_drawers, *drawer_state;
+    int i;
+    WDrawerChain *dc;
+
+    make_keys();
+
+    all_drawers = WMCreatePLArray(NULL);
+    for (i=0, dc = scr->drawers;
+         i < scr->drawer_count;
+         i++, dc = dc->next) {
+        drawer_state = drawerSaveState(scr, dc->adrawer);
+        WMAddToPLArray(all_drawers, drawer_state);
+        WMReleasePropList(drawer_state);
+    }
+    WMPutInPLDictionary(scr->session_state, dDrawers, all_drawers);
+    WMReleasePropList(all_drawers);
+}
+
+
+void
+wDrawersRestoreState(WScreen *scr)
+{
+    WMPropList *all_drawers, *drawer_state;
+    int i;
+    WDrawerChain **dc;
+
+    make_keys();
+
+    if (scr->session_state == NULL)
+        return;
+
+    all_drawers = WMGetFromPLDictionary(scr->session_state, dDrawers);
+    if (!all_drawers)
+        return;
+
+    dc = &scr->drawers;
+    for (i = 0; i < WMGetPropListItemCount(all_drawers); i++) {
+        drawer_state = WMGetFromPLArray(all_drawers, i);
+        drawerRestoreState(scr, drawer_state);
+    }
+}
diff -Naur WindowMaker-0.92.0-orig/src/dock.h WindowMaker-0.92.0/src/dock.h
--- WindowMaker-0.92.0-orig/src/dock.h	2004-10-14 19:31:49.000000000 +0200
+++ WindowMaker-0.92.0/src/dock.h	2007-01-10 23:45:03.000000000 +0100
@@ -40,6 +40,7 @@
 
 #define WM_DOCK        0
 #define WM_CLIP        1
+#define WM_DRAWER      2
 #define NORMAL_DOCK    WM_DOCK
 #define EXTENDED_DOCK  WM_CLIP
     int type;
@@ -69,7 +70,7 @@
 
 
 
-WDock *wDockCreate(WScreen *scr, int type);
+WDock *wDockCreate(WScreen *scr, int type, char *name);
 WDock *wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type);
 
 void wDockDestroy(WDock *dock);
@@ -81,10 +82,15 @@
 void wDockSaveState(WScreen *scr, WMPropList *old_state);
 
 Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y);
+void wDockReattachIcon(WDock *dock, WAppIcon *icon, int x, int y);
 Bool wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
                    int *ret_x, int *ret_y, int redocking);
 Bool wDockFindFreeSlot(WDock *dock, int *req_x, int *req_y);
 void wDockDetach(WDock *dock, WAppIcon *icon);
+Bool wDockMoveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y);
+
+void wSlideAppicons(WAppIcon **appicons, int n, int to_the_left);
+void wDrawerFillTheGap(WDock *drawer, WAppIcon *aicon, Bool redocking);
 
 void wDockFinishLaunch(WDock *dock, WAppIcon *icon);
 void wDockTrackWindowLaunch(WDock *dock, Window window);
@@ -101,9 +107,14 @@
 WMPropList *wClipSaveWorkspaceState(WScreen *scr, int workspace);
 WAppIcon *wClipRestoreState(WScreen *scr, WMPropList *clip_state);
 
+void wDrawerIconPaint(WAppIcon *dicon);
+void wDrawersSaveState(WScreen *scr, WMPropList *old_state);
+void wDrawersRestoreState(WScreen *scr);
+
 void wClipUpdateForWorkspaceChange(WScreen *scr, int workspace);
 
 RImage *wClipMakeTile(WScreen *scr, RImage *normalTile);
+RImage* wDrawerMakeTile(WScreen *scr, RImage *normalTile);
 
 #define WO_FAILED          0
 #define WO_NOT_APPLICABLE  1
diff -Naur WindowMaker-0.92.0-orig/src/funcs.h WindowMaker-0.92.0/src/funcs.h
--- WindowMaker-0.92.0-orig/src/funcs.h	2004-10-14 20:03:28.000000000 +0200
+++ WindowMaker-0.92.0/src/funcs.h	2007-01-10 23:45:03.000000000 +0100
@@ -113,6 +113,7 @@
 WWindow *NextToFocusBefore(WWindow *wwin);
 
 void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
+void SlideWindows(Window *wins[], int n, int from_x, int from_y, int to_x, int to_y);
 
 char *ShrinkString(WMFont *font, char *string, int width);
 
diff -Naur WindowMaker-0.92.0-orig/src/icon.c WindowMaker-0.92.0/src/icon.c
--- WindowMaker-0.92.0-orig/src/icon.c	2005-03-11 23:27:58.000000000 +0100
+++ WindowMaker-0.92.0/src/icon.c	2007-01-10 23:45:03.000000000 +0100
@@ -320,11 +320,20 @@
     unsigned w, h;
     int theight = WMFontHeight(scr->icon_title_font);
 
-    if (tileType == TILE_NORMAL)
-        tile = RCloneImage(scr->icon_tile);
-    else {
-        assert(scr->clip_tile);
-        tile = RCloneImage(scr->clip_tile);
+    switch (tileType) {
+    default:
+        wwarning("Unknown tileType: %d.\n", tileType);
+    case TILE_NORMAL:
+	tile = RCloneImage(scr->icon_tile);
+        break;
+    case TILE_CLIP:
+	assert(scr->clip_tile);
+	tile = RCloneImage(scr->clip_tile);
+        break;
+    case TILE_DRAWER:
+	assert(scr->drawer_tile);
+	tile = RCloneImage(scr->drawer_tile);
+        break;
     }
     if (icon) {
         w = (icon->width > wPreferences.icon_size)
diff -Naur WindowMaker-0.92.0-orig/src/icon.h WindowMaker-0.92.0/src/icon.h
--- WindowMaker-0.92.0-orig/src/icon.h	2004-10-12 19:55:34.000000000 +0200
+++ WindowMaker-0.92.0/src/icon.h	2007-01-10 23:45:03.000000000 +0100
@@ -30,6 +30,7 @@
 
 #define TILE_NORMAL	0
 #define TILE_CLIP	1
+#define TILE_DRAWER     2
 
 
 typedef struct WIcon {
diff -Naur WindowMaker-0.92.0-orig/src/misc.c WindowMaker-0.92.0/src/misc.c
--- WindowMaker-0.92.0-orig/src/misc.c	2004-11-11 14:31:47.000000000 +0100
+++ WindowMaker-0.92.0/src/misc.c	2007-01-10 23:45:03.000000000 +0100
@@ -53,6 +53,7 @@
 /**** global variables *****/
 
 extern WPreferences wPreferences;
+#define ICON_SIZE wPreferences.icon_size
 
 extern Time LastTimestamp;
 
@@ -330,9 +331,20 @@
 void
 SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y)
 {
+    Window *wins[1] = { &win };
+    SlideWindows(wins, 1, from_x, from_y, to_x, to_y);
+}
+
+/* wins is an array of Window, sorted from left to right, the first is
+ * going to be moved from (from_x,from_y) to (to_x,to_y) and the
+ * following windows are going to be offset by (ICON_SIZE*i,0) */
+void
+SlideWindows(Window *wins[], int n, int from_x, int from_y, int to_x, int to_y)
+{
     time_t time0 = time(NULL);
     float dx, dy, x=from_x, y=from_y, sx, sy, px, py;
     int dx_is_bigger=0;
+    int i;
 
     /* animation parameters */
     static struct {
@@ -397,7 +409,9 @@
             px = (sy == 0 ? 0 : py*dx/dy);
         }
 
-        XMoveWindow(dpy, win, (int)x, (int)y);
+        for (i = 0; i < n; i++) {
+            XMoveWindow(dpy, *wins[i], (int)x + i * ICON_SIZE, (int)y);
+        }
         XFlush(dpy);
         if (apars[(int)wPreferences.icon_slide_speed].delay > 0) {
             wusleep(apars[(int)wPreferences.icon_slide_speed].delay*1000L);
@@ -407,7 +421,9 @@
         if (time(NULL) - time0 > MAX_ANIMATION_TIME)
             break;
     }
-    XMoveWindow(dpy, win, to_x, to_y);
+    for (i = 0; i < n; i++) {
+        XMoveWindow(dpy, *wins[i], to_x + i * ICON_SIZE, to_y);
+    }
 
     XSync(dpy, 0);
     /* compress expose events */
diff -Naur WindowMaker-0.92.0-orig/src/screen.c WindowMaker-0.92.0/src/screen.c
--- WindowMaker-0.92.0-orig/src/screen.c	2005-07-03 02:41:30.000000000 +0200
+++ WindowMaker-0.92.0/src/screen.c	2007-01-10 23:45:03.000000000 +0100
@@ -1069,6 +1069,8 @@
         scr->clip_icon = wClipRestoreState(scr, state);
     }
 
+    wDrawersRestoreState(scr);
+
     wWorkspaceRestoreState(scr);
 
     wScreenUpdateUsableArea(scr);
@@ -1118,6 +1120,7 @@
     }
 
     wWorkspaceSaveState(scr, old_state);
+    wDrawersSaveState(scr, old_state);
 
     if (wPreferences.save_session_on_exit) {
         wSessionSaveState(scr);
diff -Naur WindowMaker-0.92.0-orig/src/screen.h WindowMaker-0.92.0/src/screen.h
--- WindowMaker-0.92.0-orig/src/screen.h	2004-10-23 01:58:59.000000000 +0200
+++ WindowMaker-0.92.0/src/screen.h	2007-01-10 23:45:03.000000000 +0100
@@ -61,6 +61,14 @@
 } WAppIconChain;
 
 
+/* Drawers, which are Docks, really */
+
+typedef struct WDrawerChain {
+    struct WDock *adrawer;
+    struct WDrawerChain *next;
+} WDrawerChain;
+
+
 /*
  * each WScreen is saved into a context associated with it's root window
  */
@@ -233,9 +241,13 @@
     struct WMenu *clip_submenu;        /* Workspace list for clips */
     struct WMenu *clip_options;	       /* Options for Clip */
     struct WMenu *clip_ws_menu;	       /* workspace menu for clip */
+    struct WMenu *drawer_menu;         /* Menu for drawers */
     struct WDock *last_dock;
     WAppIconChain *global_icons;       /* for omnipresent icons chain in clip */
     int global_icon_count;	       /* How many global icons do we have */
+    WDrawerChain *drawers;             /* Chain of drawers */
+    int drawer_count;                  /* Nb of drawers */
+    struct WDock *attracting_drawer;   /* The drawer that auto attracts icons */
 
     Window clip_balloon;	       /* window for workspace name */
 
@@ -251,6 +263,7 @@
 
     struct RImage *icon_tile;
     struct RImage *clip_tile;
+    struct RImage *drawer_tile;        /* tile for a drawer (tile + arrow) */
     Pixmap icon_tile_pixmap;	       /* for app supplied icons */
 
     Pixmap def_icon_pixmap;	       /* default icons */
diff -Naur WindowMaker-0.92.0-orig/src/startup.c WindowMaker-0.92.0/src/startup.c
--- WindowMaker-0.92.0-orig/src/startup.c	2007-01-10 23:37:35.000000000 +0100
+++ WindowMaker-0.92.0/src/startup.c	2007-01-10 23:45:03.000000000 +0100
@@ -876,7 +876,15 @@
                     }
                 }
             }
-        }
+            /* auto-launch apps in drawers */
+            {
+                WDrawerChain *dc;
+                for (dc = wScreen[j]->drawers; dc; dc = dc->next) {
+                    wScreen[j]->last_dock = dc->adrawer;
+                    wDockDoAutoLaunch(dc->adrawer, 0);
+                }
+            }
+       }
 
         /* go to workspace where we were before restart */
         if (lastDesktop >= 0) {
diff -Naur WindowMaker-0.92.0-orig/src/superfluous.c WindowMaker-0.92.0/src/superfluous.c
--- WindowMaker-0.92.0-orig/src/superfluous.c	2004-10-12 19:46:38.000000000 +0200
+++ WindowMaker-0.92.0/src/superfluous.c	2007-01-10 23:45:03.000000000 +0100
@@ -292,12 +292,45 @@
 #endif /* NORMAL_ICON_KABOOM */
 
 
+static int
+addGhostTile(WScreen *scr, RImage *back, Pixmap which, int dy, int height,
+             unsigned long red_mask, unsigned long green_mask, unsigned long blue_mask)
+{
+    XImage *img;
+    RImage *dock_image;
+
+    img = XGetImage(dpy, which, 0, 0, wPreferences.icon_size, height,
+                    AllPlanes, ZPixmap);
+    if (!img) {
+        RReleaseImage(back);
+        return -1;
+    }
+    img->red_mask = red_mask;
+    img->green_mask = green_mask;
+    img->blue_mask = blue_mask;
+
+    dock_image = RCreateImageFromXImage(scr->rcontext, img, NULL);
+    XDestroyImage(img);
+    if (!dock_image) {
+        RReleaseImage(back);
+        return -1;
+    }
+    RCombineAreaWithOpaqueness(back, dock_image, 0, 0,
+                               wPreferences.icon_size, height,
+                               0, dy, 30 * 256 / 100);
+    RReleaseImage(dock_image);
+    return 0;
+}
+
+
 Pixmap
 MakeGhostDock(WDock *dock, int sx, int dx, int y)
 {
     WScreen *scr = dock->screen_ptr;
+    WDrawerChain *dc;
+    WDock *drawer;
     XImage *img;
-    RImage *back, *dock_image;
+    RImage *back;
     Pixmap pixmap;
     int i, virtual_tiles, h, j, n;
     unsigned long red_mask, green_mask, blue_mask;
@@ -308,6 +341,10 @@
             dock->icon_array[i]->yindex > virtual_tiles)
             virtual_tiles = dock->icon_array[i]->yindex;
     }
+    for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+        if (dc->adrawer->y_pos - dock->y_pos > virtual_tiles * wPreferences.icon_size)
+            virtual_tiles = (dc->adrawer->y_pos - dock->y_pos) / wPreferences.icon_size;
+    }
     virtual_tiles++;
     h = virtual_tiles * wPreferences.icon_size;
     h = (y + h > scr->scr_height) ? scr->scr_height-y : h;
@@ -341,31 +378,25 @@
                 which = dock->icon_array[i]->icon->pixmap;
             else
                 which = dock->icon_array[i]->icon->core->window;
-
-            img=XGetImage(dpy, which, 0, 0, wPreferences.icon_size, n,
-                          AllPlanes, ZPixmap);
-
-            if (!img){
-                RReleaseImage(back);
-                return None;
-            }
-            img->red_mask = red_mask;
-            img->green_mask = green_mask;
-            img->blue_mask = blue_mask;
-
-            dock_image = RCreateImageFromXImage(scr->rcontext, img, NULL);
-            XDestroyImage(img);
-            if (!dock_image) {
-                RReleaseImage(back);
-                return None;
-            }
-            RCombineAreaWithOpaqueness(back, dock_image, 0, 0,
-                                       wPreferences.icon_size, n,
-                                       0, j, 30 * 256 / 100);
-            RReleaseImage(dock_image);
+            if (addGhostTile(scr, back, which, j, n, red_mask, green_mask, blue_mask))
+                return None; /* back is released by addGhostTile */
         }
     }
-
+    for (dc = scr->drawers; dc != NULL; dc = dc->next) {
+        Pixmap which;
+        drawer = dc->adrawer;
+        if (drawer->y_pos >= scr->scr_height)
+            continue;
+        j = drawer->y_pos - dock->y_pos;
+        n = (h - j < wPreferences.icon_size) ? h - j :
+                                               wPreferences.icon_size;
+        if (drawer->icon_array[0]->icon->pixmap)
+            which = drawer->icon_array[0]->icon->pixmap;
+        else
+            which = drawer->icon_array[0]->icon->core->window;
+        if (addGhostTile(scr, back, which, j, n, red_mask, green_mask, blue_mask))
+            return None; /* back is released by addGhostTile */
+    }
 
     RConvertImage(scr->rcontext, back, &pixmap);
 
diff -Naur WindowMaker-0.92.0-orig/src/wdefaults.c WindowMaker-0.92.0/src/wdefaults.c
--- WindowMaker-0.92.0-orig/src/wdefaults.c	2004-10-12 19:49:01.000000000 +0200
+++ WindowMaker-0.92.0/src/wdefaults.c	2007-01-10 23:45:03.000000000 +0100
@@ -609,3 +609,35 @@
     return WMGetFromPLString(value);
 }
 
+
+void
+wDefaultPurgeInfo(WScreen *scr, char *instance, char *class)
+{
+    WMPropList *value, *key, *dict;
+    char *buffer;
+
+    if (!AIcon) { /* Unnecessary precaution */
+        init_wdefaults(scr);
+    }
+
+    WMPLSetCaseSensitive(True);
+
+    buffer = wmalloc(strlen(class) + strlen(instance) + 2);
+    sprintf(buffer, "%s.%s", instance, class);
+    key = WMCreatePLString(buffer);
+
+    dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, key);
+
+    if (dict) {
+        value = WMGetFromPLDictionary(dict, AIcon);
+        if (value) {
+            WMRemoveFromPLDictionary(dict, AIcon);
+        }
+        WMRemoveFromPLDictionary(WDWindowAttributes->dictionary, key);
+        UpdateDomainFile(WDWindowAttributes);
+    }
+
+    wfree(buffer);
+    WMReleasePropList(key);
+    WMPLSetCaseSensitive(False);
+}
diff -Naur WindowMaker-0.92.0-orig/src/workspace.c WindowMaker-0.92.0/src/workspace.c
--- WindowMaker-0.92.0-orig/src/workspace.c	2007-01-10 23:35:51.000000000 +0100
+++ WindowMaker-0.92.0/src/workspace.c	2007-01-10 23:45:03.000000000 +0100
@@ -106,7 +106,7 @@
 
 
         if (!wPreferences.flags.noclip) {
-            wspace->clip = wDockCreate(scr, WM_CLIP);
+            wspace->clip = wDockCreate(scr, WM_CLIP, NULL);
         } else
             wspace->clip = NULL;
 
diff -Naur WindowMaker-0.92.0-orig/WindowMaker/Defaults/WMWindowAttributes.in WindowMaker-0.92.0/WindowMaker/Defaults/WMWindowAttributes.in
--- WindowMaker-0.92.0-orig/WindowMaker/Defaults/WMWindowAttributes.in	2005-03-22 22:25:23.000000000 +0100
+++ WindowMaker-0.92.0/WindowMaker/Defaults/WMWindowAttributes.in	2007-01-11 00:10:33.000000000 +0100
@@ -2,6 +2,7 @@
   Logo.WMDock = {Icon = GNUstepGlow.#extension#;};
   Logo.WMPanel = {Icon = GNUstep.#extension#;};
   Logo.WMClip = {Icon = clip.#extension#;};
+  WMDrawer = {Icon = Drawer.png;};
   Dockit = {Icon = GNUstep.#extension#;};
   DockApp = {NoAppIcon = NO;};
   WSoundServer = {Icon = sound.#extension#;};
diff -Naur WindowMaker-0.92.0-orig/WindowMaker/Icons/Drawer.png WindowMaker-0.92.0/WindowMaker/Icons/Drawer.png
--- WindowMaker-0.92.0-orig/WindowMaker/Icons/Drawer.png	1970-01-01 01:00:00.000000000 +0100
+++ WindowMaker-0.92.0/WindowMaker/Icons/Drawer.png	2007-01-11 00:11:35.000000000 +0100
@@ -0,0 +1,10 @@
+‰PNG
+
+
IHDR00Wù‡gAMA† 1è–_CIDATxÚíYMˆEþªª§gvvfv5¢FpƒˆAð$âAOž¢‚DðâÑ£Ç\<xñäQðâ1Wõ$9ÔxÈE!	"$˜%Ñd]w×ÍlïôOU==ÕSSSÝÓ“^a=óªºú{ÿïõKZÒ’þ×Ä÷ÆOßïHEp¯>^ òG™k
+›9ã«‹£©‚E�öÁ€\€†|àí5[wÝ¦ƒ‘B'äÅ~³wû`Vø`à. yÚóñæYÀÔ>çá# ÅøüÃ5Êæ€uM^uõ¹‡�o+(_òÌ*àu|Óå÷V¤"tB>åN†oïí„qªg´mt÷o]­´²…×_j#ÉqFðI’JZ(v|ûSI6ÃKSÂÍÍÛÃÉ=J”^À…ì)´[¬ôÁ‹PæÙox¤§yR÷%®ÝIpòxX	¾R€áHc”2&"š¨¼ÇÕl^Ër—L	lnIìÆ'ÇàË…@Sî¿Fãuƒ¹¬7�`�zº~d
+ÞÄâúñ˜§É&à}µÃGó,ÀÿðU™Ì^i‚ÔT©ùÚd²9x7}Vi^ªé€muÀßÚŒÝ¶ðVZ»Xuº@E¥çÙu¡Vñ¬ÏùüÆKX{:!ŸÑ²ÝÓtÆÅL&Õà•&hj(@]Zí@oebãßD“ö!É¨²ÿq]Š³Y÷ñÅDc\—9~¼‡÷Î¾‚�gÖñû­-|wáW<Ø‰ 8
+�¤ÇÅâTg	�åËš7À
Ðwßy§Ž!ÇÆÆ“xóÕ
ìG�5Fq2UmðÆÕ|ÝjU 7²€›ç¥"œZí»1Ð�{)Âv÷wÖW9‚!Ë5ïQU#‚£"Â•›[xá¹'@Dx¸›àÇ«[ØÞÏÍßëjáLkâÓ8QuÔH€²"†—ïàÅ�§Ñï®àúí=|óó=(	¤@¬)sK1Æ¼Ú�S
¥	ŒÍ
+å‹� )p;UJEF1~úåîï(lïk(	´[@ØÊp¥�˜�\ Geà‹LÄC´Æu`•4ŽI!4’ŒÐn1¬÷ÛètÚèöúHwfbg2$�‡'½è&¨ßë¯M
+X‹ƒˆÐa„§8amàVº=t»+øç¯»^ð�`È4:èµ&èEšºšïaTÌÚñáxH!‚ äm€$Ö¥»Pî„h�‘�`Å€c°Ðœ³Å,�·å9ßýmgŒA0€3Bœj´Ð
+xé~· Ð6øFíô¼×(e]ek0ÆÀ«Üï«œå®dk½qªóRÊõíy
+0ñc¯Ï][¥	‰$Æº¯œ¦Kzª±ÞÞtœÆç£ÑtPT¹ËBA¥„Ý¡Æƒ=…QªM”
óª¦à¬hÈÄ8 Ýý‚3p–'ŽL6h®ÞNpë^†a¤Ç™ev�áåÆ¦¯¾½Œù×M˜v”§Ÿm0œ>âô‰°Öàm·RKÓeÖ1<Û†aÀ±—á@Sõ:Q**À»�g@ùp]É\�«)ÍšàÈÝ µsjÝ)ÿ©ÔÞ£Toý7ÂLŸwé†b	à°¿¼Íòñ[+ä}KÍÙ”;…y1ÛÿöŠ\Û¡¸çìkÄ‚ûƒ×¨ø‡æ“·WÉÉ×½¼9Àóö|ñýðOŸ __ÊÿIùè�vÁ;9)}Þ¹3ý»±9L�kÅ$ 4á‡ë²ô¾Zø´Þ„Î�é‡˜$m}gÚ¿ýE“ÀÅkÙ‘>{IKZÒ’–4Eÿâß¯c7ôIEND®B`‚
\ No newline at end of file
