changeset 3452:dbad02a89dc2 trunk

Please do us the favour of compile testing any commits to the live tree. Thank you.
author Tony Vroon <chainsaw@gentoo.org>
date Sat, 08 Sep 2007 00:27:13 +0100
parents 24f190625644
children fb270cb264d7
files src/audacious/dock.c
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/dock.c	Sat Sep 08 00:01:44 2007 +0300
+++ b/src/audacious/dock.c	Sat Sep 08 00:27:13 2007 +0100
@@ -224,6 +224,7 @@
     for (node = list; node; node = g_list_next(node)) {
         dw = node->data;
         gtk_window_move(dw->w, x + dw->offset_x, y + dw->offset_y);
+        gdk_flush();
     }
 }
 
@@ -463,15 +464,16 @@
 dock_move_press(GList * window_list, GtkWindow * w,
                 GdkEventButton * event, gboolean move_list)
 {
+    gint mx, my;
     DockedWindow *dwin;
 
     if (cfg.show_wm_decorations)
         return;
 
     gtk_window_present(w);
-
-    gtk_object_set_data(GTK_OBJECT(w), "move_offset_x", GINT_TO_POINTER(event->x));
-    gtk_object_set_data(GTK_OBJECT(w), "move_offset_y", GINT_TO_POINTER(event->y));
+    gdk_window_get_pointer(GTK_WIDGET(w)->window, &mx, &my, NULL);
+    gtk_object_set_data(GTK_OBJECT(w), "move_offset_x", GINT_TO_POINTER(mx));
+    gtk_object_set_data(GTK_OBJECT(w), "move_offset_y", GINT_TO_POINTER(my));
     if (move_list)
         gtk_object_set_data(GTK_OBJECT(w), "docked_list",
                             get_docked_list(NULL, window_list, w, 0, 0));
@@ -488,10 +490,12 @@
 void
 dock_move_motion(GtkWindow * w, GdkEventMotion * event)
 {
-    gint offset_x, offset_y, win_x, win_y, x, y;
+    gint offset_x, offset_y, win_x, win_y, x, y, mx, my;
     GList *dlist;
     GList *window_list;
 
+    gdk_flush();
+
     if (!gtk_object_get_data(GTK_OBJECT(w), "is_moving"))
         return;
 
@@ -504,8 +508,10 @@
 
     gtk_window_get_position(w, &win_x, &win_y);
 
-    x = event->x_root - offset_x;
-    y = event->y_root - offset_y;
+    gdk_window_get_pointer(NULL, &mx, &my, NULL);
+
+    x = mx - offset_x;
+    y = my - offset_y;
 
     calc_snap_offset(dlist, window_list, x, y, &offset_x, &offset_y);
     x += offset_x;