changeset 2492:ea80fe9c3ba4 trunk

[svn] - use ConfigureNotify to set playlist location, a proper use of ICCCM.
author nenolod
date Fri, 09 Feb 2007 22:30:10 -0800
parents 2aeea41ef023
children b7f48f00a342
files ChangeLog src/audacious/build_stamp.c src/audacious/ui_playlist.c
diffstat 3 files changed, 27 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Feb 09 22:05:03 2007 -0800
+++ b/ChangeLog	Fri Feb 09 22:30:10 2007 -0800
@@ -1,3 +1,12 @@
+2007-02-10 06:05:03 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [3992]
+  - using ConfigureNotify for resizing is wrong per ICCCM guideline, 
+    handling resize independently of the WM is correct per ICCCM.
+  
+  trunk/src/audacious/ui_playlist.c |   75 +++++++++++++++++++++++---------------
+  1 file changed, 46 insertions(+), 29 deletions(-)
+
+
 2007-02-09 11:04:35 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [3990]
   - trying to open filebrowser when it is already open will raise the filebrowser.
--- a/src/audacious/build_stamp.c	Fri Feb 09 22:05:03 2007 -0800
+++ b/src/audacious/build_stamp.c	Fri Feb 09 22:30:10 2007 -0800
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070209-3990";
+const gchar *svn_stamp = "20070210-3992";
--- a/src/audacious/ui_playlist.c	Fri Feb 09 22:05:03 2007 -0800
+++ b/src/audacious/ui_playlist.c	Fri Feb 09 22:30:10 2007 -0800
@@ -685,7 +685,18 @@
     gdk_window_clear(playlistwin->window);
 }
 
+static gboolean
+playlistwin_configure(GtkWidget * window,
+                      GdkEventConfigure * event, gpointer data)
+{
+    if (!GTK_WIDGET_VISIBLE(window))
+        return FALSE;
 
+    cfg.playlist_x = event->x;
+    cfg.playlist_y = event->y;
+
+    return TRUE;
+}
 
 static void
 playlistwin_motion(GtkWidget * widget,
@@ -1044,25 +1055,14 @@
           event->x >= playlistwin_get_width() - 31 &&
           event->x < playlistwin_get_width() - 22))) {
 
-        /* This code is disabled because gtk_window_begin_resize_drag is
-         * highly broken. --nenolod
-         */
-#if 0
-        /* NOTE: Workaround for bug #214 */
+        g_print("foo\n");
+
         if (event->type != GDK_2BUTTON_PRESS && 
             event->type != GDK_3BUTTON_PRESS) {
-            /* resize area */
             playlistwin_resizing = TRUE;
-            gtk_window_begin_resize_drag(GTK_WINDOW(widget),
-                                         GDK_WINDOW_EDGE_SOUTH_EAST,
-                                         event->button,
-                                         event->x + xpos, event->y + ypos,
-                                         event->time);
+            playlistwin_resize_x = cfg.playlist_width - event->x;
+            playlistwin_resize_y = cfg.playlist_height - event->y;
         }
-#endif
-        playlistwin_resizing = TRUE;
-        playlistwin_resize_x = cfg.playlist_width - event->x;
-        playlistwin_resize_y = cfg.playlist_height - event->y;
     }
     else if (event->button == 1 && REGION_L(12, 37, 29, 11)) {
         /* ADD button menu */
@@ -1721,6 +1721,8 @@
                            G_CALLBACK(playlistwin_focus_in), NULL);
     g_signal_connect_after(playlistwin, "focus_out_event",
                            G_CALLBACK(playlistwin_focus_out), NULL);
+    g_signal_connect(playlistwin, "configure_event",
+                     G_CALLBACK(playlistwin_configure), NULL);
     g_signal_connect(playlistwin, "style_set",
                      G_CALLBACK(playlistwin_set_back_pixmap), NULL);