GNOME Bugzilla – Bug 628241
Messagetray shows scrolling area regardless whether it is needed or not
Last modified: 2010-08-30 21:46:55 UTC
Created attachment 168992 [details] Screenshot showing the issue After commit 93d3270566a2b4873ec72417d68096909e0ad4a8 (https://bugzilla.gnome.org/show_bug.cgi?id=627985) we always show the scrolling area regardless whether it is needed or not (see screenshot).
Created attachment 168993 [details] [review] [Messagetray] Don't create the label in addBody when no text is passed In case we don't have any text yet this could result into a wrong allocation, and causing us to show a scrolling area even for only one line texts.
how does trying to add an empty label cause this bug?
(decided against the NEEDINFO marking. Will leave NEEDINFO to mean "need info from the reporter")
(In reply to comment #2) > how does trying to add an empty label cause this bug? Because we add "dead" labels that fill up space, as each call to addBody adds a new actor.
(In reply to comment #4) > (In reply to comment #2) > > how does trying to add an empty label cause this bug? > > Because we add "dead" labels that fill up space, as each call to addBody adds a > new actor. As for the question why we do that: Commit 93d3270566a2b4873ec72417d68096909e0ad4a8 adds a call to idle handle which calls _addBannerBody() in _bannerBoxAllocate() ... so when _bannerBoxAllocate() is called multple times it queues a call to to _addBannerBody(), the first one sets _bannerBodyText to null and therefore the later ones add null as text.
Created attachment 169129 [details] [review] [MessageTray] Avoid calling addBannerBody whit an empty text in _bannerBoxAllocate Commit 93d3270566a2b4873ec72417d68096909e0ad4a8 adds a call to idle handle which calls _addBannerBody() in _bannerBoxAllocate() ... so when _bannerBoxAllocate() is called multple times it queues a call to to _addBannerBody(), the first one sets _bannerBodyText to null and therefore the later ones add null as text. Fix that by checking for null in the idle handler. ------ Different fix
The problem you are solving here is solved in this patch: https://bugzilla.gnome.org/show_bug.cgi?id=623970#c11 We check if this._bannerBodyText is no null inside _addBannerBody() in it. *** This bug has been marked as a duplicate of bug 623970 ***
Review of attachment 169129 [details] [review]: Thanks! This patch looks right, but this bug is fixed with a different patch that reorganizes the code for adding the banner body a bit more.
Review of attachment 168993 [details] [review]: OK, so lets get this one of the patch queue too.