--- gtkscalebutton.c
+++ gtkscalebutton.c
@@ -891,7 +891,8 @@
   gdouble v;
   GdkDisplay *display;
   GdkScreen *screen;
-
+  gboolean is_moved;
+  is_moved = FALSE;
   button = GTK_SCALE_BUTTON (widget);
   priv = button->priv;
   adj = priv->adjustment;
@@ -963,20 +964,29 @@
 						 button_event->y_root);
       gdk_screen_get_monitor_geometry (screen, monitor, &rect);
 
-      if (priv->orientation == GTK_ORIENTATION_VERTICAL)
-        y += button_event->y;
-      else
-        x += button_event->x;
-
-      if (y < rect.y)
-	y = rect.y;
-      else if (y + d->allocation.height > rect.height + rect.y)
-	y = rect.y + rect.height - d->allocation.height;
-
-      if (x < rect.x)
-	x = rect.x;
-      else if (x + d->allocation.width > rect.width + rect.x)
-	x = rect.x + rect.width - d->allocation.width;
+       /* Move the dock, but set is_moved so we
+        * don't forward the first click later on,
+        * as it could make the scale go to the bottom */
+        if (priv->orientation == GTK_ORIENTATION_VERTICAL)
+         y += button_event->y;
+       else
+         x += button_event->x;
+
+       if (y < rect.y) {
+        y = rect.y;
+       is_moved = TRUE;
+       } else if (y + d->allocation.height > rect.height + rect.y) {
+        y = rect.y + rect.height - d->allocation.height;
+       is_moved = TRUE;
+       }
+
+       if (x < rect.x) {
+        x = rect.x;
+       is_moved = TRUE;
+       } else if (x + d->allocation.width > rect.width + rect.x) {
+        x = rect.x + rect.width - d->allocation.width;
+       is_moved = TRUE;
+       }
     }
 
   gtk_window_move (GTK_WINDOW (priv->dock), x, y);
@@ -1007,7 +1017,7 @@
 
   gtk_widget_grab_focus (priv->dock);
 
-  if (event->type == GDK_BUTTON_PRESS)
+  if (event->type == GDK_BUTTON_PRESS && !is_moved)
     {
       GdkEventButton *e;
       GdkEventButton *button_event = (GdkEventButton *) event;
