After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 133260 - Small mode horribly broken in sawfish
Small mode horribly broken in sawfish
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
HEAD
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 152007 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-02-02 23:29 UTC by Crispin Flowerday (not receiving bugmail)
Modified: 2005-06-07 22:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debian patch used to implement suggested workaround (505 bytes, patch)
2005-05-17 14:05 UTC, Loïc Minier
none Details | Review

Description Crispin Flowerday (not receiving bugmail) 2004-02-02 23:29:04 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.
Comment 1 Sebastien Bacher 2004-07-08 00:23:26 UTC
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."
Comment 2 Ken Harris 2004-07-21 06:38:57 UTC
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.
Comment 3 [ATR]Dj-Death 2004-07-23 21:21:40 UTC
Same problem with the WaÏmea window manager (waimea.org)
Comment 4 Ken Harris 2004-09-13 10:34:58 UTC
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.
Comment 5 Colin Walters 2004-09-16 20:54:05 UTC
*** Bug 152007 has been marked as a duplicate of this bug. ***
Comment 6 Jean-Christophe Dubacq 2005-04-22 10:27:31 UTC
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
Comment 7 Loïc Minier 2005-04-24 12:58:46 UTC
Presumably, gtk_window_set_geometry_hints() with a hints.max_height set to zero
was erroneous, and -1 was meant?
Comment 8 Loïc Minier 2005-05-17 14:05:22 UTC
Created attachment 46546 [details] [review]
Debian patch used to implement suggested workaround
Comment 9 Bastien Nocera 2005-06-07 22:33:36 UTC
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