GNOME Bugzilla – Bug 133260
Small mode horribly broken in sawfish
Last modified: 2005-06-07 22:33:36 UTC
This may be a sawfish problem, but if you try the small mode when running under sawfish, basically the content area of the window shrinks to 0 pixels high, so you can't see anything. If you then drag the bottom border down, it snaps back to a sensible size, but any further resizing puts it back at 0 pixels again. It has something to do with the "hints.max_height = 0" in the rb-shell.c, if I set this to 30, I get _very_ odd behaviour, in that the window seems to swap continuously between 30 pixels high, and the proper height. I'm using the 1:1.3+cvs20031104-4 sawfish package from debian, and rhythmbox is built from CVS using jhbuild.
This bug has been reported in the Debian BTS too: http://bugs.debian.org/257838 "I have got a problem using rhythmbox with my window manager (Sawfish) when I want to use the reduced mode of rhythmbox. Here you can see a little shot with the rhythmbox reduced window. http://landwerl.free.fr/shot.png I had a look at the rhythmbox's sources. In file shell/rb-shell.c : reduced mode is trigged like that : gtk_window_resize (GTK_WINDOW (shell->priv->window), small_width, 1); This the problem, because sawfish really resizes the window with height = 1. I think that use gtk_widget_get_child_requisition to get the minimum requested size, and then call gtk_widget_size_request to resize the window at the good size would be a good idea."
My gut is saying this is a Sawfish bug, but I can't quote chapter and verse on how a window manager is supposed to deal with size requests. It works fine under Metacity (though admittedly Metacity does have some workarounds for broken programs, and I'm not positive this isn't one of them). If you're interested in investigating window manager size requests, you might take a look at cgoban (1, not 2, which is a completely different program). The game window will let you resize it taller than it is wide, but not shorter than that. Under Sawfish, it simply crashes if you make it shorter than it is wide. (Under Metacity, it doesn't let you make it that short, which is a neat effect.) Or you could ask the Metacity guys. They can probably tell you exactly what's going on.
Same problem with the WaÏmea window manager (waimea.org)
Took a glance at this again, since I'm poking around Gtk+ and Metacity anyway. If you actually read the documentation for gtk_window_resize(), it says "Resizes the window as if the user had done so, obeying geometry constraints. The default geometry constraint is that windows may not be smaller than their size request". I've confirmed that Rhythmbox doesn't change the default constraint: gtk_widget_get_size_request() returns -1 x -1 ("unset"). gtk_widget_set_size_request() says: "If the size request in a given direction is -1 (unset), then the "natural" size request of the widget will be used instead." So it looks to me like Rhythmbox isn't doing anything wrong. It's asking Gtk+ for the "natural" height for this window. It's just that its geometry constraints are getting lost somewhere between Rhythmbox and your display. That means it's either a Gtk+ bug, or a Sawfish bug. And it works fine under Metacity -- I think that if it was a Gtk+ bug, it would fail the same under all window managers. So it definitely looks like a Sawfish (and Waimea) bug to me.
*** Bug 152007 has been marked as a duplicate of this bug. ***
I have been investigating this problem. The trouble is in rhythmbox because apart from setting the height to 1, it also sets the maximum size to 3000x0 which is transformed by gtk in a max size of 3000x1. Why would it do that? hints.max_height = 0; hints.max_width = 3000; gtk_window_set_geometry_hints (GTK_WINDOW (shell->priv->window), NULL, &hints, GDK_HINT_MAX_SIZE); As a consequence, sawfish sets the size based on hints that are: configure: dims (812 . 225) hints ((window-gravity . north-west) (max-width . 3000) (max-height . 1) (min-width . 331) (min-height . 72)) safey 1 Please note the contradiction in max-height and min-height. Maybe metacity acts first upon max-height then upon min-height. Sawfish (and waimea does the opposite). Therefore, rhythmbox should not do this. Jean-Christophe Dubacq -- jcdubacq1@free.fr
Presumably, gtk_window_set_geometry_hints() with a hints.max_height set to zero was erroneous, and -1 was meant?
Created attachment 46546 [details] [review] Debian patch used to implement suggested workaround
Please test current CVS HEAD, and report back if this change doesn't fix the problem. 2005-06-07 Bastien Nocera <hadess@hadess.net> * shell/rb-shell.c: (rb_shell_sync_window_state): Patch from jonathan@kaolin.hn.org to work-around problems with some unforgiving window managers while switching to the small mode