changeset 1063:73be9df33f30 trunk

[svn] - revert back to dock.c, commit 1/2.
author nenolod
date Tue, 16 May 2006 17:05:47 -0700
parents b727849e2128
children 13d721835794
files audacious/equalizer.c audacious/mainwin.c audacious/ui_playlist.c
diffstat 3 files changed, 10 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/audacious/equalizer.c	Mon May 15 20:55:19 2006 -0700
+++ b/audacious/equalizer.c	Tue May 16 17:05:47 2006 -0700
@@ -373,14 +373,7 @@
             grab = FALSE;
         }
         else {
-            gint mx, my;
             equalizerwin_raise();
-
-            gdk_window_get_pointer(GDK_WINDOW(equalizerwin->window), &mx, &my, NULL);
-            gtk_object_set_data(GTK_OBJECT(equalizerwin), "offset_x", GINT_TO_POINTER(mx));
-            gtk_object_set_data(GTK_OBJECT(equalizerwin), "offset_y", GINT_TO_POINTER(my));
-
-            gtk_object_set_data(GTK_OBJECT(equalizerwin), "is_moving", GINT_TO_POINTER(1));
         }
     }
     else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS
@@ -423,25 +416,8 @@
 {
     GdkEvent *gevent;
 
-    if (gtk_object_get_data(GTK_OBJECT(equalizerwin), "is_moving"))
-    {
-        gint offset_x, offset_y, mx, my, x, y;
-
-        offset_x = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(equalizerwin), "offset_x"));
-        offset_y = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(equalizerwin), "offset_y"));
-
-        gdk_window_get_pointer(NULL, &mx, &my, NULL);
-
-        x = mx - offset_x;
-        y = my - offset_y;
-
-        gtk_window_move(GTK_WINDOW(equalizerwin), x, y);
-    }
-    else
-    {
-        handle_motion_cb(equalizerwin_wlist, widget, event);
-        draw_main_window(FALSE); /* XXX: shouldn't this be draw_equalizer_window()? */
-    }
+    handle_motion_cb(equalizerwin_wlist, widget, event);
+    draw_main_window(FALSE); /* XXX: shouldn't this be draw_equalizer_window()? */
 
     gdk_flush();
 
@@ -457,10 +433,6 @@
     gdk_pointer_ungrab(GDK_CURRENT_TIME);
     gdk_flush();
 
-    gtk_object_remove_data(GTK_OBJECT(equalizerwin), "is_moving");
-    gtk_object_remove_data(GTK_OBJECT(equalizerwin), "offset_x");
-    gtk_object_remove_data(GTK_OBJECT(equalizerwin), "offset_y");
-
     handle_release_cb(equalizerwin_wlist, widget, event);
     draw_equalizer_window(FALSE);
 
--- a/audacious/mainwin.c	Mon May 15 20:55:19 2006 -0700
+++ b/audacious/mainwin.c	Tue May 16 17:05:47 2006 -0700
@@ -998,9 +998,10 @@
 
     gdk_flush();
 
-    gtk_object_remove_data(GTK_OBJECT(mainwin), "is_moving");
-    gtk_object_remove_data(GTK_OBJECT(mainwin), "offset_x");
-    gtk_object_remove_data(GTK_OBJECT(mainwin), "offset_y");
+    if (mainwin_menurow->mr_doublesize_selected) {
+        event->x /= 2;
+        event->y /= 2;
+    }
 
     handle_release_cb(mainwin_wlist, widget, event);
 
@@ -1036,25 +1037,8 @@
         state = event->state;
     }
 
-    if (gtk_object_get_data(GTK_OBJECT(mainwin), "is_moving"))
-    {
-	gint offset_x, offset_y, mx, my;
-
-	offset_x = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(mainwin), "offset_x"));
-	offset_y = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(mainwin), "offset_y"));
-
-        gdk_window_get_pointer(NULL, &x, &y, NULL);
-
-	mx = x - offset_x;
-	my = y - offset_y;
-
-        gtk_window_move(GTK_WINDOW(mainwin), mx, my);
-    }
-    else
-    {    
-        handle_motion_cb(mainwin_wlist, widget, event);
-        draw_main_window(FALSE);
-    }
+    handle_motion_cb(mainwin_wlist, widget, event);
+    draw_main_window(FALSE);
 
     gdk_flush();
 
@@ -1134,16 +1118,7 @@
             grab = FALSE;
         }
         else
-        {
-	    gint mx, my;
-
-	    gdk_window_get_pointer(GDK_WINDOW(mainwin->window), &mx, &my, NULL);
-	    gtk_object_set_data(GTK_OBJECT(mainwin), "offset_x", GINT_TO_POINTER(mx));
-	    gtk_object_set_data(GTK_OBJECT(mainwin), "offset_y", GINT_TO_POINTER(my));
-
-            gtk_object_set_data(GTK_OBJECT(mainwin), "is_moving", GINT_TO_POINTER(1));
             gtk_window_present(GTK_WINDOW(mainwin));
-        }
     }
     else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS &&
              event->y < 14 && !inside_sensitive_widgets(event->x, event->y)) {
--- a/audacious/ui_playlist.c	Mon May 15 20:55:19 2006 -0700
+++ b/audacious/ui_playlist.c	Tue May 16 17:05:47 2006 -0700
@@ -576,10 +576,6 @@
     if (cfg.playlist_transparent)
         playlistwin_update_list();
 
-    gtk_object_remove_data(GTK_OBJECT(playlistwin), "is_moving");
-    gtk_object_remove_data(GTK_OBJECT(playlistwin), "offset_x");
-    gtk_object_remove_data(GTK_OBJECT(playlistwin), "offset_y");
-
     handle_release_cb(playlistwin_wlist, widget, event);
     playlist_popup_destroy();
     draw_playlist_window(FALSE);
@@ -699,25 +695,8 @@
 {
     GdkEvent *gevent;
 
-    if (gtk_object_get_data(GTK_OBJECT(playlistwin), "is_moving"))
-    {
-        gint offset_x, offset_y, mx, my, x, y;
-
-        offset_x = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(playlistwin), "offset_x"));
-        offset_y = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(playlistwin), "offset_y"));
-
-        gdk_window_get_pointer(NULL, &mx, &my, NULL);
-
-        x = mx - offset_x;
-        y = my - offset_y;
-
-        gtk_window_move(GTK_WINDOW(playlistwin), x, y);
-    }
-    else
-    {
-        handle_motion_cb(playlistwin_wlist, widget, event);
-        draw_playlist_window(FALSE);
-    }
+    handle_motion_cb(playlistwin_wlist, widget, event);
+    draw_playlist_window(FALSE);
 
     gdk_flush();
 
@@ -1114,14 +1093,6 @@
     else if (event->button == 1 && event->type == GDK_BUTTON_PRESS &&
              !inside_sensitive_widgets(event->x, event->y) && event->y < 14)
     {
-        gint mx, my;
-
-        gdk_window_get_pointer(GDK_WINDOW(playlistwin->window), &mx, &my, NULL);
-
-        gtk_object_set_data(GTK_OBJECT(playlistwin), "offset_x", GINT_TO_POINTER(mx));
-        gtk_object_set_data(GTK_OBJECT(playlistwin), "offset_y", GINT_TO_POINTER(my));
-
-        gtk_object_set_data(GTK_OBJECT(playlistwin), "is_moving", GINT_TO_POINTER(1));
         gtk_window_present(GTK_WINDOW(playlistwin));
     }
     else if (event->button == 1 && event->type == GDK_2BUTTON_PRESS &&