diff -r -u xfwm4-4.4.1.top_resize/src/events.c xfwm4-4.4.1/src/events.c
--- xfwm4-4.4.1.top_resize/src/events.c	2007-05-27 20:57:06.000000000 -0400
+++ xfwm4-4.4.1/src/events.c	2007-05-27 21:30:00.000000000 -0400
@@ -577,46 +577,79 @@
     XAllowEvents (display_info->dpy, AsyncKeyboard, CurrentTime);
 }
 
+static void
+button2Action (Client * c, XButtonEvent * ev)
+{
+    ScreenInfo *screen_info = c->screen_info;
+    XfwmButtonClickType tclick;
+
+    tclick = typeOfClick (screen_info, c->window, (XEvent *) ev, FALSE);
+    if (tclick == XFWM_BUTTON_CLICK)
+    {
+        if (clientRaiseOrLower (c, None))
+        {
+            if (!(c->type & WINDOW_TYPE_DONT_FOCUS))
+            {
+                clientSetFocus (c->screen_info, c, ev->time, NO_FOCUS_FLAG);
+            }
+        }
+    }
+    else if (tclick != XFWM_BUTTON_UNDEFINED)
+    {
+        moveRequest (c, (XEvent *) ev);
+    }
+}
+
+static void
+button3Action (Client * c, XButtonEvent * ev)
+{
+    ScreenInfo *screen_info = c->screen_info;
+
+    ev->window = ev->root;
+    if (screen_info->button_handler_id)
+    {
+        g_signal_handler_disconnect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
+    }
+    screen_info->button_handler_id = g_signal_connect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)),
+                                              "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) c);
+    /* Let GTK handle this for us. */
+}
+
 /* User has clicked on an edge or corner.
- * Button 1 : Raise and resize
- * Button 2 : Move
- * Button 3 : Resize
+ * Button 1 : click=raise, drag_title=move drag_frame=resize
+ * Button 2 : click=raise&lower, drag=move
+ * Button 3 : post menu
  */
 static void
 edgeButton (Client * c, int part, XButtonEvent * ev)
 {
-    ScreenInfo *screen_info;
-    int state;
-
-    screen_info = c->screen_info;
-    state = ev->state & MODIFIER_MASK;
-
     if (ev->button == Button2)
     {
+        button2Action(c, ev);
+    }
+    else if (ev->button == Button1)
+    {
         XfwmButtonClickType tclick;
+        ScreenInfo *screen_info;
 
+        screen_info = c->screen_info;
         tclick = typeOfClick (screen_info, c->window, (XEvent *) ev, FALSE);
         if (tclick == XFWM_BUTTON_CLICK)
         {
-            clientLower (c, None);
+            if (!(c->type & WINDOW_TYPE_DONT_FOCUS))
+            {
+                clientSetFocus (c->screen_info, c, ev->time, NO_FOCUS_FLAG);
+            }
+            clientRaise (c, None);
         }
         else if (tclick != XFWM_BUTTON_UNDEFINED)
         {
-            moveRequest (c, (XEvent *) ev);
+            resizeRequest (c, part, (XEvent *) ev);
         }
     }
-    else if ((ev->button == Button1) || (ev->button == Button3))
+    else if (ev->button == Button3)
     {
-        if ((ev->button == Button1) ||
-            ((screen_info->params->easy_click) && (state == screen_info->params->easy_click)))
-        {
-            if (!(c->type & WINDOW_TYPE_DONT_FOCUS))
-            {
-                clientSetFocus (screen_info, c, ev->time, NO_FOCUS_FLAG);
-            }
-            clientRaise (c, None);
-        }
-        resizeRequest (c, part, (XEvent *) ev);
+        button3Action(c, ev);
     }
 }
 
@@ -707,21 +740,31 @@
     screen_info = c->screen_info;
     display_info = screen_info->display_info;
 
-    if (!(c->type & WINDOW_TYPE_DONT_FOCUS))
-    {
-        clientSetFocus (screen_info, c, ev->time, NO_FOCUS_FLAG);
-    }
-    clientRaise (c, None);
-
     memcpy(&copy_event, ev, sizeof(XEvent));
-    tclick = typeOfClick (screen_info, c->window, &copy_event, TRUE);
+
+    /* Unfortunately, typeOfClick with double click allowed must wait
+       for a timeout period after the first click to see if a second
+       click is going to occur. We can't wait that long to find out
+       whether the window should be raise. The ability to double click
+       must be sacrificed. */
+    /* tclick = typeOfClick (screen_info, c->window, &copy_event, TRUE); */
+    tclick = typeOfClick (screen_info, c->window, &copy_event, FALSE);
 
     if ((tclick == XFWM_BUTTON_DRAG)
         || (tclick == XFWM_BUTTON_CLICK_AND_DRAG))
     {
         moveRequest (c, (XEvent *) ev);
     }
-    else if (tclick == XFWM_BUTTON_DOUBLE_CLICK)
+    else
+    {
+        if (!(c->type & WINDOW_TYPE_DONT_FOCUS))
+        {
+            clientSetFocus (screen_info, c, ev->time, NO_FOCUS_FLAG);
+        }
+        clientRaise (c, None);
+    }
+
+    if (tclick == XFWM_BUTTON_DOUBLE_CLICK)
     {
         switch (screen_info->params->double_click_action)
         {
@@ -760,44 +803,11 @@
     }
     else if (ev->button == Button2)
     {
-        clientLower (c, None);
+        button2Action (c, ev);
     }
     else if (ev->button == Button3)
     {
-        /*
-           We need to copy the event to keep the original event untouched
-           for gtk to handle it (in case we open up the menu)
-         */
-
-        XEvent copy_event;
-        XfwmButtonClickType tclick;
-
-        memcpy(&copy_event, ev, sizeof(XEvent));
-        tclick = typeOfClick (screen_info, c->window, &copy_event, FALSE);
-
-        if (tclick == XFWM_BUTTON_DRAG)
-        {
-            moveRequest (c, (XEvent *) ev);
-        }
-        else if (tclick != XFWM_BUTTON_UNDEFINED)
-        {
-            if (!(c->type & WINDOW_TYPE_DONT_FOCUS))
-            {
-                clientSetFocus (screen_info, c, ev->time, NO_FOCUS_FLAG);
-            }
-            if (screen_info->params->raise_on_click)
-            {
-                clientRaise (c, None);
-            }
-            ev->window = ev->root;
-            if (screen_info->button_handler_id)
-            {
-                g_signal_handler_disconnect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
-            }
-            screen_info->button_handler_id = g_signal_connect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)),
-                                                      "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) c);
-            /* Let GTK handle this for us. */
-        }
+        button3Action (c, ev);
     }
     else if (ev->button == Button4)
     {
diff -r -u xfwm4-4.4.1.top_resize/src/stacking.c xfwm4-4.4.1/src/stacking.c
--- xfwm4-4.4.1.top_resize/src/stacking.c	2007-03-15 18:29:49.000000000 -0400
+++ xfwm4-4.4.1/src/stacking.c	2007-05-27 21:24:05.000000000 -0400
@@ -531,6 +531,27 @@
     }
 }
 
+/* Raise the window unless it is already topmost.
+   Lower the window if it is already topmost */
+/* BUG: This is not what the user expects. The user
+   will expect that the window be raised if it is covered
+   and lowered if it is fully exposed. "covered" and "fully
+   exposed" is ot synonymous with topmost and not-topmost */
+int
+clientRaiseOrLower(Client *c, Window wsibling)
+{
+    if (clientIsTopMost(c))
+    {
+        clientLower(c, wsibling);
+        return 0;
+    }
+    else
+    {
+        clientRaise(c, wsibling);
+        return 1;
+    }
+}
+
 gboolean
 clientAdjustFullscreenLayer (Client *c, gboolean set)
 {
diff -r -u xfwm4-4.4.1.top_resize/src/stacking.h xfwm4-4.4.1/src/stacking.h
--- xfwm4-4.4.1.top_resize/src/stacking.h	2007-03-11 09:44:43.000000000 -0400
+++ xfwm4-4.4.1/src/stacking.h	2007-05-27 21:26:26.000000000 -0400
@@ -48,6 +48,8 @@
                                                                  Window);
 void                     clientLower                            (Client *, 
                                                                  Window);
+int                      clientRaiseOrLower                     (Client *, 
+                                                                 Window);
 gboolean                 clientAdjustFullscreenLayer            (Client *, 
                                                                  gboolean);
 void                     clientAddToList                        (Client *);
