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 340107 - status icon size returns bogus value
status icon size returns bogus value
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkStatusIcon
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 348971 377674 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-04-29 12:03 UTC by Christian Persch
Modified: 2014-08-30 05:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase as patch for teststatusicon.c (1.21 KB, text/plain)
2006-04-29 12:04 UTC, Christian Persch
  Details
proposed patch (2.35 KB, patch)
2007-01-29 15:02 UTC, Christian Persch
committed Details | Review

Description Christian Persch 2006-04-29 12:03:40 UTC
The first call to gtk_status_icon_get_size seems to return bogus values (I always get 200 here.) This is bad because you may want to use that value on startup to load your pixbufs at that size for use in the status icon...
Comment 1 Christian Persch 2006-04-29 12:04:12 UTC
Created attachment 64517 [details]
testcase as patch for teststatusicon.c
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2006-12-03 05:20:47 UTC
*** Bug 377674 has been marked as a duplicate of this bug. ***
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2006-12-03 05:38:38 UTC
As you can see on the duplicate (reported by me) this indeed happens. Marking as NEW.
Comment 4 Matthias Clasen 2007-01-01 07:52:35 UTC
*** Bug 348971 has been marked as a duplicate of this bug. ***
Comment 5 Christian Persch 2007-01-29 15:02:17 UTC
Created attachment 81439 [details] [review]
proposed patch

This patch fixes the problem. It makes sure to only update the size if the icon is embedded, and clarifies the docs to that effect.
Comment 6 Matthias Clasen 2007-01-30 19:22:12 UTC
This is documentation addition is certainly good:

* Note that the returned size is only meaningful while the status
* icon is embedded (see gtk_status_icon_is_embedded())

But why do we need to do anything else ? 

Returning 0 when non-embedded will only break the users which are currently 
getting a surprise value of 200 in a worse way, since trying to construct
a pixbuf of size 0 will fail.
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2007-04-16 20:38:35 UTC
The idea of getting the value before embedding is to construct a correct size pixbuf.
Comment 8 Christian Persch 2007-04-16 21:00:55 UTC
Actually the idea behind returning an invalid size when _not_ embedded was to make it clear that you shouldn't construct a pixbuf before the embedding has negotiated the size.
Comment 9 Matthias Clasen 2007-04-28 15:56:45 UTC
I have committed the doc addition.

2007-04-28  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkstatusicon.c (gtk_status_icon_get_size): Add
        a note about being embedded.  (#340107, Christian Persch)

Comment 10 Matthias Clasen 2014-08-30 05:20:40 UTC
GtkStatusIcon has been deprecated