changeset 455:f001b217c88b trunk

[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
author giacomo
date Wed, 17 Jan 2007 08:46:53 -0800
parents 6c1c03111db4
children 2e0b55117302
files ChangeLog src/statusicon/si_ui.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 17 08:27:05 2007 -0800
+++ b/ChangeLog	Wed Jan 17 08:46:53 2007 -0800
@@ -1,3 +1,10 @@
+2007-01-17 16:27:05 +0000  Giacomo Lozito <james@develia.org>
+  revision [992]
+  - use xmms_show_message for the about box
+  trunk/src/statusicon/si_ui.c |   33 ++++++++++++++++++++++++---------
+  1 file changed, 24 insertions(+), 9 deletions(-)
+
+
 2007-01-17 11:34:44 +0000  Giacomo Lozito <james@develia.org>
   revision [990]
   - status icon plugin: use scroll wheel on the status icon to change volume
--- a/src/statusicon/si_ui.c	Wed Jan 17 08:27:05 2007 -0800
+++ b/src/statusicon/si_ui.c	Wed Jan 17 08:46:53 2007 -0800
@@ -201,6 +201,17 @@
 {
   GdkPixbuf *si_pixbuf, *si_scaled_pixbuf;
   gint size = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(image) , "size" ));
+  static gchar *wmname = NULL;
+
+  /* sometimes, KDE won't give the correct size-allocation; workaround this */
+  if ( wmname == NULL )
+  {
+    GdkScreen *screen = gdk_screen_get_default();
+    if ( screen != NULL )
+      wmname = (gchar*)gdk_x11_screen_get_window_manager_name( screen );
+  }
+  else if ( ( size > 22 ) && ( !strcmp("KWin",wmname) ) )
+    size = 22;
 
   si_pixbuf = gdk_pixbuf_new_from_xpm_data( (const char**)si_xpm );
   si_scaled_pixbuf = gdk_pixbuf_scale_simple( si_pixbuf , size , size , GDK_INTERP_BILINEAR );