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 119647 - window menu should trail the name of the windows
window menu should trail the name of the windows
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: window selector
unspecified
Other All
: Normal minor
: ---
Assigned To: Panel Maintainers
Panel Maintainers
: 113347 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-08-11 15:59 UTC by markush
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (1.74 KB, patch)
2003-10-08 11:18 UTC, Vincent Untz
none Details | Review
Updated patch using eel_ellipsizing_label (4.16 KB, patch)
2003-10-09 11:52 UTC, Vincent Untz
none Details | Review
patch (1.13 KB, patch)
2003-10-21 12:45 UTC, Soren Sandmann Pedersen
none Details | Review
new patch (1.69 KB, patch)
2003-10-21 13:17 UTC, Soren Sandmann Pedersen
none Details | Review
new patch (2.04 KB, patch)
2003-10-21 15:56 UTC, Soren Sandmann Pedersen
none Details | Review
New patch (2.13 KB, patch)
2003-10-21 16:46 UTC, Soren Sandmann Pedersen
none Details | Review

Description markush 2003-08-11 15:59:18 UTC
Description of Problem:


Steps to reproduce the problem:
1. create a window with a long title. e.g. with a
simple html page and a really long <title>-tag
2. open that page and look at the length of the
entry in the window menu
3. oops its really long

Actual Results:
string can cover the whole screen, thus the whole
menu covers the screen

Expected Results:
string should be trailed like "Foo ..." at 32
chars or more. dunno how much is functional. if
string is trailed let it scroll when mouse is over
the entry

How often does this happen? 
allways

Additional Information:

gnome2.2 debian unstable

thanks ppl
Comment 1 Vincent Untz 2003-09-22 15:07:45 UTC
*** Bug 113347 has been marked as a duplicate of this bug. ***
Comment 2 Vincent Untz 2003-10-08 11:18:18 UTC
Created attachment 20562 [details] [review]
Proposed patch.
Comment 3 Vincent Untz 2003-10-08 11:22:45 UTC
Here's a patch that trims the window names if they're longer than 32
characters. I'm not sure if it should be done here or if we should add
something for that in libwnck.

There's a (minor) problem : if the font is not monospaced, then the
characters don't have the same length and thus, the trimmed strings
don't all have the same length (some are longer than others). Maybe
there's a way to know the size a string will occupy once displayed and
it'd be better to use it.
Comment 4 Mark McLoughlin 2003-10-08 12:20:41 UTC
First off, I'm not sure this is such a huge issue that its worth
fixing .... I don't see the big problem with really long menu items ...

If we are going to fix I'd like use to use EelEllipsizingLabel (which
should really be in gtk+) to do it. i.e. each menu item would hold the
GtkImage and the ellipsizing label and you'd fix the requisition of
the menuitem at something like 1/6 of the screen width. See
gnome-terminal/src/eel for how to copy and paste the code for linking
into the panel.

(Thanks for the patch though Vincent)

Comment 5 Vincent Untz 2003-10-08 14:48:56 UTC
Mark: does that mean that you're ok if I copy this eel stuff in
applets/wncklet/ ? Or do you prefer to WONTFIX the bug ?
Comment 6 Mark McLoughlin 2003-10-08 15:09:32 UTC
Yeah, I'm okay with copying the eel stuff - in theory it should only
by temporary ... i.e. until gtk+ gets an ellipsizing label
Comment 7 Vincent Untz 2003-10-09 11:52:45 UTC
Created attachment 20592 [details] [review]
Updated patch using eel_ellipsizing_label
Comment 8 Vincent Untz 2003-10-09 11:54:00 UTC
This patch should be a better one :-)
Comment 9 Mark McLoughlin 2003-10-09 12:16:03 UTC
Patch looks really good vincent ... Some comments:

* Put all the eel stuff in applets/wncklet/eel the way 
  gnome-terminal does it.

* window_menu_image_menu_item_new_with_eel_label could be called
  window_menu_item_new or something simple like that :-)

* the set_size_request line should be split up for clarity. I'd
  do something like

  {
     int screen_width;

     screen_width = gdk_screen_get_width (
                       gtk_widget_get_screen (window_menu->applet));

     gtk_widget_set_size_request (item, screen_width / 6, -1);
  }


Once you've fixed up those minor nits, please go ahead and commit
to HEAD.

And thanks :-)
Comment 10 Vincent Untz 2003-10-09 12:44:30 UTC
Committed with above comments.
Comment 11 Dennis Cranston 2003-10-10 06:18:43 UTC
Just a thought...  Text in the window list applet is truncated but not
ellipsized, and file names in the Actions->Open Recent menu can be
quite long.  To be consistent, shouldn't we truncate and ellipsize the
text in the window list applet and the open recent menu items too?
Comment 12 Vincent Untz 2003-10-10 06:29:33 UTC
Yeah, it'd be nice. I suppose you should open bugs against
libegg/recent-files and libwnck for this and refer to this bug. Please
cc me in these bugs.
Thanks
Comment 13 Soren Sandmann Pedersen 2003-10-21 12:43:01 UTC
I think the screen_size/6 is way too small. Almost all my window
titles are clipped so that I can't read them.

I am attaching a patch that makes the clamp size screen_width/2
instead of screen_width/6, and only sets the size request to that if
the item's own request would be larger.

The effect is to clamp to make the width 

            MAX (screen_width/2, natural size)

instead of unconditionally screen_width/6.
Comment 14 Soren Sandmann Pedersen 2003-10-21 12:45:17 UTC
Created attachment 20842 [details] [review]
patch
Comment 15 Soren Sandmann Pedersen 2003-10-21 12:50:54 UTC
That should be

        MIN (screen_size/2, natural_size)

of course
Comment 16 Vincent Untz 2003-10-21 13:02:13 UTC
IMHO screen_size/2 is really too large. I'd prefer if it were
screen_size/4 (or maybe screen_size/3, but it starts to look too large
again).

Mark: what do you think?
Comment 17 Soren Sandmann Pedersen 2003-10-21 13:16:02 UTC
How about this patch then, that goes back to using 32 characters as
the maximum (only done with
pango_font_metrics_get_approximate_char_width())? 
Comment 18 Soren Sandmann Pedersen 2003-10-21 13:17:44 UTC
Created attachment 20844 [details] [review]
new patch
Comment 19 Vincent Untz 2003-10-21 13:26:32 UTC
Sounds reasonable.
But, hrm, stupid question: does your patch work for you? Here it
doesn't work: it seems the labels don't tell the size they need, so I
just see the icons.
Comment 20 Soren Sandmann Pedersen 2003-10-21 15:54:40 UTC
No, it doesn't work. I forgot three things, (a) how broken
EelEllipsizingLabel is, (b) that a widget needs a screen before its
style->font_desc will be correct, and (c) to use PANGO_PIXELS.

Here is a new patch. I used 56 characters instead of 32, because
otherwise there is simply too many window titles that get unrecognizable.
Comment 21 Soren Sandmann Pedersen 2003-10-21 15:56:39 UTC
Created attachment 20847 [details] [review]
new patch
Comment 22 Soren Sandmann Pedersen 2003-10-21 16:46:58 UTC
Created attachment 20849 [details] [review]
New patch
Comment 23 Soren Sandmann Pedersen 2003-10-21 17:01:15 UTC
This final patch also clamps the size of the menu to 3/4 times the
screen size.
Comment 24 Vincent Untz 2003-10-22 00:44:56 UTC
Man, your titles must be really long. 56 characters looks like a lot.
I tried with 44 characters and it looks nicer for me. Anyway, this is
personal taste, I assume. I'd feel better with a value like 50, though.

Sounds ok to commit, but as I'm not a maintainer...
Mark: is it ok for you?
Comment 25 Soren Sandmann Pedersen 2003-10-22 00:57:13 UTC
> Man, your titles must be really long. 56 characters looks like a lot.

Well, I use them to distinguis xterms, eg.

    xterm: /home/ssp/vertigo/gnome-panel/applets/wncklet/

Using 50 would be fine by me.
Comment 26 Mark McLoughlin 2003-10-23 10:24:03 UTC
I haven't reviewed the patch too closely but I trust both of you so
... please go ahead and commit to HEAD :-)
Comment 27 Soren Sandmann Pedersen 2003-10-23 11:25:32 UTC
Thu Oct 23 13:19:01 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* window-menu.c: Make the width of the window menu the minimum of
	3/4 * screen width, approx. 50 characters and the menu's
	natural width.