Package: last-exit
Version: 1.0-1
Severity: wishlist
Tags: patch

Currently, the Last Exit window can be resized vertically. As the
widgets don't move around to use this space, the net result is a big
blank space. Therefore, I think that vertical resizing for the window
should be disabled.

I've attached a patch to fix this, by calculating the required window
height, and using SetGeometryHints() to force the window to always be
the required height. It currently recalculates every time the cover
image is changed, as I've noticed that some cover images appear to make
the window fractionally larger.

-- System Information:
Debian Release: testing/unstable
  APT prefers stable
  APT policy: (990, 'stable'), (103, 'testing'), (102, 'unstable'), (99, 
'experimental'), (97, 'dapper')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages last-exit depends on:
ii  gconf2                     2.14.0-1      GNOME configuration database syste
ii  libatk1.0-0                1.11.4-2      The ATK accessibility toolkit
ii  libc6                      2.3.6-15      GNU C Library: Shared libraries
ii  libcairo2                  1.2.0-2       The Cairo 2D vector graphics libra
ii  libfontconfig1             2.3.2-7       generic font configuration library
ii  libgconf2-4                2.14.0-1      GNOME configuration database syste
ii  libgconf2.0-cil            2.8.2-2       CLI binding for GConf 2.12
ii  libglade2.0-cil            2.8.2-2       CLI binding for the Glade librarie
ii  libglib2.0-0               2.12.0-0      The GLib library of C routines
ii  libglib2.0-cil             2.8.2-2       CLI binding for the GLib utility l
ii  libgnome2.0-cil            2.8.2-2       CLI binding for GNOME 2.12
ii  libgstreamer0.10-0         0.10.8-2      Core GStreamer libraries and eleme
ii  libgtk2.0-0                2.8.18-4      The GTK+ graphical user interface 
ii  libgtk2.0-cil              2.8.2-2       CLI binding for the GTK+ toolkit 2
ii  libmono-corlib1.0-cil      1.1.13.6-4    Mono core library (1.0)
ii  libmono-system-web1.0-cil  1.1.13.6-4    Mono System.Web library
ii  libmono-system1.0-cil      1.1.13.6-4    Mono System libraries (1.0)
ii  libmono1.0-cil             1.1.13.6-4    Mono libraries (1.0)
ii  liborbit2                  1:2.14.0-2    libraries for ORBit2 - a CORBA ORB
ii  libpango1.0-0              1.13.2-0      Layout and rendering of internatio
ii  libx11-6                   2:1.0.0-7     X11 client-side library
ii  libxcursor1                1.1.5.2-5     X cursor management library
ii  libxext6                   1:1.0.0-4     X11 miscellaneous extension librar
ii  libxfixes3                 1:3.0.1.2-4   X11 miscellaneous 'fixes' extensio
ii  libxi6                     1:1.0.0-5     X11 Input extension library
ii  libxinerama1               1:1.0.1-4     X11 Xinerama extension library
ii  libxml2                    2.6.26.dfsg-1 GNOME XML library
ii  libxrandr2                 2:1.1.0.2-4   X11 RandR extension library
ii  libxrender1                1:0.9.0.2-4   X Rendering Extension client libra
ii  mono-runtime               1.1.13.6-4    Mono runtime

last-exit recommends no packages.

-- no debconf information
--- src/MagicCoverImage.cs.old	2006-07-12 13:11:58.000000000 +0200
+++ src/MagicCoverImage.cs	2006-07-12 13:16:18.000000000 +0200
@@ -30,6 +30,9 @@
 		private Pixbuf current;
 		private Pixbuf next;
 
+		public delegate void CoverImageChangedHandler (MagicCoverImage mci);
+		public event CoverImageChangedHandler CoverImageChanged;
+
 		private TimeSpan start;
 
 		const double FADE_DURATION = 1500.0;
@@ -47,6 +50,9 @@
 				next = pb;
 				start_fade ();
 			}
+			if (CoverImageChanged != null) {
+				CoverImageChanged (this);
+			}
 		}
 
 		private void start_fade () {
--- src/PlayerWindow.cs.old	2006-07-10 18:51:36.000000000 +0200
+++ src/PlayerWindow.cs.notray	2006-07-12 13:22:29.000000000 +0200
@@ -182,6 +182,7 @@
 
 			cover_image = new MagicCoverImage ();
 			cover_image_container.Add (cover_image);
+			cover_image.CoverImageChanged += new MagicCoverImage.CoverImageChangedHandler(set_height_limit);
 			cover_image.Visible = true;
 
 			love_image = new Image ();
@@ -257,6 +258,19 @@
 			cover_image.ChangePixbuf (cover);
 		}
 		
+		private void set_height_limit(MagicCoverImage mci)
+		{
+			int height = 0;
+			int width = 0;
+			GetSize(out width, out height);
+			Gdk.Geometry limits = new Gdk.Geometry();
+			limits.MinHeight = height;
+			limits.MaxHeight = height;
+			limits.MinWidth = SizeRequest().Width;
+			limits.MaxWidth = Gdk.Screen.Default.Width;
+			SetGeometryHints(this,limits,Gdk.WindowHints.MaxSize|Gdk.WindowHints.MinSize);
+		}
+
 		private void add_station (Gdk.Pixbuf image,
 					  string name,
 					  string path,

Reply via email to