ScreenShield: wait for stage mapping before taking a grab

In gdm, we would attempt to become modal during the synchronous initialization,
and this would fail, as X prevents grabs on unmapped windows. Instead,
wait for the stage to be visible before becoming modal.

https://bugzilla.gnome.org/show_bug.cgi?id=683357
This commit is contained in:
Giovanni Campagna 2012-09-04 20:47:20 +02:00
parent b7ae74edb9
commit be290fafe7

View File

@ -558,11 +558,17 @@ const ScreenShield = new Lang.Class({
}, },
showDialog: function() { showDialog: function() {
// Ensure that the stage window is mapped, before taking a grab
// otherwise X errors out
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
if (!this._isModal) { if (!this._isModal) {
Main.pushModal(this.actor); Main.pushModal(this.actor);
this._isModal = true; this._isModal = true;
} }
return false;
}));
this.actor.show(); this.actor.show();
this._isGreeter = Main.sessionMode.isGreeter; this._isGreeter = Main.sessionMode.isGreeter;
this._ensureUnlockDialog(); this._ensureUnlockDialog();