From 7e70dfdf4c78a39678f91e77f4917f004a740a0f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 20 Sep 2011 15:52:42 -0400 Subject: [PATCH] messageTray: Fix line wrapping Clutter 1.4 had a bug where it would wrap when it wasn't supposed to, and we were unknowingly relying on it. Explicitly pass the available width/height to get a perfect allocation. https://bugzilla.gnome.org/show_bug.cgi?id=659633 --- js/ui/messageTray.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 9476d7aec..ef0d59395 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -792,11 +792,12 @@ Notification.prototype = { }, _bannerBoxAllocate: function(actor, box, flags) { - let [titleMinW, titleNatW] = this._titleLabel.get_preferred_width(-1); - let [titleMinH, titleNatH] = this._titleLabel.get_preferred_height(-1); - let [bannerMinW, bannerNatW] = this._bannerLabel.get_preferred_width(-1); let availWidth = box.x2 - box.x1; + let [titleMinW, titleNatW] = this._titleLabel.get_preferred_width(-1); + let [titleMinH, titleNatH] = this._titleLabel.get_preferred_height(availWidth); + let [bannerMinW, bannerNatW] = this._bannerLabel.get_preferred_width(availWidth); + let titleBox = new Clutter.ActorBox(); let titleBoxW = Math.min(titleNatW, availWidth); if (this._titleDirection == St.TextDirection.RTL) {