magnifier: Return all parameters on sprite content preferred size

ClutterContent's get_preferred_size should return a boolean weather the
preferred size is valid, so in javascript we've to return this state value
before out width and height.

Since this was not happening, clutter was considering the width as the state
(converting the non-zero value to true), the height as the width, while ignoring
the returned height (that was then defaulted to 0)

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1020
This commit is contained in:
Marco Trevisan (Treviño) 2019-03-11 20:36:55 +00:00
parent 4f0851ca77
commit 7eee0e0ed6

View File

@ -56,9 +56,9 @@ var MouseSpriteContent = GObject.registerClass({
vfunc_get_preferred_size() {
if (!this._texture)
return [0, 0];
return [false, 0, 0];
return [this._texture.get_width(), this._texture.get_height()];
return [true, this._texture.get_width(), this._texture.get_height()];
}
vfunc_paint_content(actor, node) {