windowMenu: Ensure the source actor isn't sized 0x0

If the source actor is sized 0x0, the grabHelper will close the menu
on button release if the menu ends up flipped because in that case the
release event happens when the pointer is neither over the source
actor (since it's 0x0) or over the menu actor. A zero sized source
actor works for the non-flipped menu case because the menu's actor
itself ends up underneath the pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=756605
This commit is contained in:
Rui Matos 2015-10-19 19:06:28 +02:00
parent 48a1fce151
commit 9c74e22313

View File

@ -214,7 +214,7 @@ const WindowMenuManager = new Lang.Class({
menu.close(); menu.close();
}); });
this._sourceActor.set_size(rect.width, rect.height); this._sourceActor.set_size(Math.max(1, rect.width), Math.max(1, rect.height));
this._sourceActor.set_position(rect.x, rect.y); this._sourceActor.set_position(rect.x, rect.y);
this._sourceActor.show(); this._sourceActor.show();