changeset 4521:6353bd9e4f05

save windows positions in docked_list_move(); remove ui_skinned_window_configure()
author Tomasz Mon <desowin@gmail.com>
date Mon, 28 Apr 2008 16:18:06 +0200
parents 917112233875
children 8f36cce36fef
files src/audacious/dock.c src/audacious/ui_skinned_window.c
diffstat 2 files changed, 25 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/dock.c	Mon Apr 28 00:14:46 2008 +0200
+++ b/src/audacious/dock.c	Mon Apr 28 16:18:06 2008 +0200
@@ -28,6 +28,7 @@
 #include <gdk/gdk.h>
 #include <stdlib.h>
 #include "main.h"
+#include "ui_skinned_window.h"
 
 #include "platform/smartinclude.h"
 
@@ -226,6 +227,28 @@
     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);
+
+        SkinnedWindow *window = SKINNED_WINDOW(dw->w);
+        if (window) {
+            switch(window->type) {
+
+            case WINDOW_MAIN:
+                cfg.player_x = x + dw->offset_x;
+                cfg.player_y = y + dw->offset_y;
+                break;
+            case WINDOW_EQ:
+                cfg.equalizer_x = x + dw->offset_x;
+                cfg.equalizer_y = y + dw->offset_y;
+                break;
+            case WINDOW_PLAYLIST:
+                cfg.playlist_x = x + dw->offset_x;
+                cfg.playlist_y = y + dw->offset_y;
+                break;
+            }
+
+            window->x = x + dw->offset_x;
+            window->y = y + dw->offset_y;
+        }
     }
 }
 
--- a/src/audacious/ui_skinned_window.c	Mon Apr 28 00:14:46 2008 +0200
+++ b/src/audacious/ui_skinned_window.c	Mon Apr 28 16:18:06 2008 +0200
@@ -66,46 +66,6 @@
   return window_type;
 }
 
-static gboolean
-ui_skinned_window_configure(GtkWidget *widget,
-                            GdkEventConfigure *event)
-{
-    GtkWidgetClass *widget_class;
-    SkinnedWindow *window = SKINNED_WINDOW(widget);
-
-    widget_class = (GtkWidgetClass*) parent;
-
-    if (widget_class->configure_event != NULL)
-        widget_class->configure_event(widget, event);
-
-    if (!GTK_WIDGET_VISIBLE(widget))
-        return FALSE;
-
-    switch(window->type) {
-        case WINDOW_MAIN:
-            if (cfg.show_wm_decorations)
-                gdk_window_get_root_origin(widget->window, &cfg.player_x, &cfg.player_y);
-            else
-                gdk_window_get_deskrelative_origin(widget->window, &cfg.player_x, &cfg.player_y);
-            break;
-        case WINDOW_EQ:
-            cfg.equalizer_x = event->x;
-            cfg.equalizer_y = event->y;
-            break;
-        case WINDOW_PLAYLIST:
-            cfg.playlist_x = event->x;
-            cfg.playlist_y = event->y;
-            break;
-    }
-
-    window->x = event->x;
-    window->y = event->y;
-
-    gtk_window_set_keep_above(GTK_WINDOW(widget), cfg.always_on_top);
-
-    return FALSE;
-}
-
 static void
 ui_skinned_window_map(GtkWidget *widget)
 {
@@ -116,6 +76,8 @@
         gtk_widget_shape_combine_mask(widget, skin_get_mask(aud_active_skin, SKIN_MASK_MAIN + cfg.player_shaded), 0, 0);
     else if (window->type == WINDOW_EQ)
         gtk_widget_shape_combine_mask(widget, skin_get_mask(aud_active_skin, SKIN_MASK_EQ + cfg.equalizer_shaded), 0, 0);
+
+    gtk_window_set_keep_above(GTK_WINDOW(widget), cfg.always_on_top);
 }
 
 static gboolean
@@ -212,7 +174,6 @@
 
     parent = gtk_type_class(gtk_window_get_type());
 
-    widget_class->configure_event = ui_skinned_window_configure;
     widget_class->motion_notify_event = ui_skinned_window_motion_notify_event;
     widget_class->expose_event = ui_skinned_window_expose;
     widget_class->focus_in_event = ui_skinned_window_focus_in;