GNOME Bugzilla – Bug 645719
Make sure notification has all the content when it is expanded
Last modified: 2011-03-29 02:43:01 UTC
Waiting for the banner body to be added in the main loop when we are showing an expanded notification was causing it to show up with an ellipsized banner and only get the full content after it is done animating. This was the case for notifications that are shown fully expanded the first time they are ever shown, such as the summary notifications that were not shown as banners because the user was in the Busy mode or was interacting with the summary. This patch reworks how we handle adding expanded content. It ensures that we do so when it is needed and that we only do so once. Previously, we used to schedule numerous content updates that each resulted in Notification emitting the 'expanded' signal. Processing these updates was holding up processing other things, such as the user moving the mouse away from the notification so that the notification collapses.
Created attachment 184268 [details] [review] Make sure notification has all the content when it is expanded
Created attachment 184380 [details] [review] Make sure notification has all the content when it is expanded Use Meta.later_add() with BEFORE_REDRAW rather than Mainloop.idle_add() to add the banner body so that the notification body is reliably added after the first frame is drawn. This is important for notifications that are expanded right away, such as the summary notifications that were not shown as banners because the user was in the Busy mode or was interacting with the summary. Otherwise, these notifications were sometimes shown with an ellipsized banner and were only getting full content when they were done animating. Only add expanded content and signal the change once. Previously, we used to signal the change numerous times and processing this signal was holding up processing other things, such as the user moving the mouse away from the notification so that the notification collapses.
Comment on attachment 184380 [details] [review] Make sure notification has all the content when it is expanded >Only add expanded content and signal the change once. Previously, we >used to signal the change numerous times it seems like it would be better to move most of the conditionals outside of the later, and only schedule that function if it's actually going to do something. (You can test this._bannerBodyText != null to see if _addBannerBody() is going to do something.)
Created attachment 184504 [details] [review] Make sure notification has all the content when it is expanded Only schedule or execute expanding content when it is necessary.
Comment on attachment 184504 [details] [review] Make sure notification has all the content when it is expanded yeah, looks good