windowPreview: Make St.Label use single line mode

When a windowPreview is hovered or selected, it will show its window's
title as a caption. That title may contain Newline characters which will
effect the windowPreview size. Make the caption's St.Label use single
line mode to prevent that.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4162

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1822>
This commit is contained in:
Leleat 2021-04-23 20:25:07 +02:00
parent 380d61dc43
commit 4e35ca8e26

View File

@ -151,6 +151,7 @@ var WindowPreview = GObject.registerClass({
text: this._getCaption(),
reactive: true,
});
this._title.clutter_text.single_line_mode = true;
this._title.add_constraint(new Clutter.BindConstraint({
source: windowContainer,
coordinate: Clutter.BindCoordinate.X,