changeset 1856:6597c7bd11d9 trunk

[svn] - avoid recreating the window unless an actual size-dimensional change has occured.
author nenolod
date Wed, 11 Oct 2006 17:53:03 -0700
parents ec2899d8b8af
children 2ed05cc57194
files ChangeLog audacious/mainwin.c
diffstat 2 files changed, 39 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 11 17:47:31 2006 -0700
+++ b/ChangeLog	Wed Oct 11 17:53:03 2006 -0700
@@ -1,3 +1,11 @@
+2006-10-12 00:47:31 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [2667]
+  - don't use hardcoded values for the time indicator area
+  
+  trunk/audacious/mainwin.c |   16 ++++++++++------
+  1 file changed, 10 insertions(+), 6 deletions(-)
+
+
 2006-10-11 19:37:16 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2665]
   - add the Osmosis skin, a more sophisticated example of the new skinning engine.
--- a/audacious/mainwin.c	Wed Oct 11 17:47:31 2006 -0700
+++ b/audacious/mainwin.c	Wed Oct 11 17:53:03 2006 -0700
@@ -951,9 +951,40 @@
 	widget_move(WIDGET(mainwin_about), bmp_active_skin->properties.mainwin_about_x,
 		bmp_active_skin->properties.mainwin_about_y);
 
+    /* visibility attributes */
+    if (bmp_active_skin->properties.mainwin_menurow_visible)
+        widget_show(WIDGET(mainwin_menurow));
+    else
+        widget_hide(WIDGET(mainwin_menurow));
+
+    if (bmp_active_skin->properties.mainwin_text_visible)
+        widget_show(WIDGET(mainwin_info));
+    else
+        widget_hide(WIDGET(mainwin_info));
+
+    if (bmp_active_skin->properties.mainwin_othertext_visible)
+        widget_show(WIDGET(mainwin_othertext));
+    else
+        widget_hide(WIDGET(mainwin_othertext));
+
+    if (bmp_active_skin->properties.mainwin_vis_visible)
+        widget_show(WIDGET(mainwin_vis));
+    else
+        widget_hide(WIDGET(mainwin_vis));
+
     /* window size, mainwinWidth && mainwinHeight properties */
     if (bmp_active_skin->properties.mainwin_height && bmp_active_skin->properties.mainwin_width)
     {
+	gint width, height;
+
+	gdk_window_get_size(mainwin->window, &width, &height);
+
+	if (width == bmp_active_skin->properties.mainwin_width &&
+		height == bmp_active_skin->properties.mainwin_height)
+	{
+		return;
+	}
+
         gdk_window_set_hints(mainwin->window, 0, 0,
                                 bmp_active_skin->properties.mainwin_width,
                                 cfg.player_shaded ? MAINWIN_SHADED_HEIGHT : bmp_active_skin->properties.mainwin_height,
@@ -976,27 +1007,6 @@
 	widget_list_change_pixmap(mainwin_wlist, mainwin_bg);
 	gdk_flush();
     }
-
-    /* visibility attributes */
-    if (bmp_active_skin->properties.mainwin_menurow_visible)
-        widget_show(WIDGET(mainwin_menurow));
-    else
-        widget_hide(WIDGET(mainwin_menurow));
-
-    if (bmp_active_skin->properties.mainwin_text_visible)
-        widget_show(WIDGET(mainwin_info));
-    else
-        widget_hide(WIDGET(mainwin_info));
-
-    if (bmp_active_skin->properties.mainwin_othertext_visible)
-        widget_show(WIDGET(mainwin_othertext));
-    else
-        widget_hide(WIDGET(mainwin_othertext));
-
-    if (bmp_active_skin->properties.mainwin_vis_visible)
-        widget_show(WIDGET(mainwin_vis));
-    else
-        widget_hide(WIDGET(mainwin_vis));
 }
 
 void