From b3b30f239d43611466c89559bc1d90155b54bacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 1 Jun 2017 16:36:10 +0200 Subject: [PATCH] workspace: Don't restrict title width to window preview Now that only one window title is visible at any time, it no longer matters if a title extends into other window previews, so we can always show the full title. https://bugzilla.gnome.org/show_bug.cgi?id=783953 --- js/ui/workspace.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 7399a6e1c..37425d31f 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -538,24 +538,13 @@ var WindowOverlay = new Lang.Class({ else button.set_position(Math.floor(buttonX), Math.floor(buttonY)); - // Clutter.Actor.get_preferred_width() will return the fixed width if one - // is set, so we need to reset the width by calling set_width(-1), to forward - // the call down to StLabel. - // We also need to save and restore the current width, otherwise the animation - // starts from the wrong point. - let prevTitleWidth = title.width; - title.set_width(-1); - let [titleMinWidth, titleNatWidth] = title.get_preferred_width(-1); - let titleWidth = Math.max(titleMinWidth, Math.min(titleNatWidth, cloneWidth)); - title.width = prevTitleWidth; - - let titleX = cloneX + (cloneWidth - titleWidth) / 2; + let titleX = cloneX + (cloneWidth - title.width) / 2; let titleY = cloneY + cloneHeight - (title.height - this.borderSize) / 2; - if (animate) - this._animateOverlayActor(title, Math.floor(titleX), Math.floor(titleY), titleWidth); - else { - title.width = titleWidth; + if (animate) { + this._animateOverlayActor(title, Math.floor(titleX), Math.floor(titleY), title.width); + } else { + title.width = title.width; title.set_position(Math.floor(titleX), Math.floor(titleY)); }