Change keyboard handling API to handle nested modal calls

Rename beginModal/endModal to pushModal/popModal.  All of the current callers
just want to ensure that we're in a modal state; they don't actually need to
fail if we already are.

These functions also now take the Clutter keyboard focus, while recording
the previous focus.

https://bugzilla.gnome.org/show_bug.cgi?id=595116
This commit is contained in:
Colin Walters
2009-09-15 15:53:07 -04:00
parent 2ddc7cf00f
commit 8a2bfd0e55
4 changed files with 87 additions and 31 deletions

View File

@ -386,7 +386,7 @@ LookingGlass.prototype = {
activatable: true,
singleLineMode: true,
text: ''});
/* kind of a hack */
/* unmapping the edit box will un-focus it, undo that */
notebook.connect('selection', Lang.bind(this, function (nb, child) {
if (child == this._evalBox)
global.stage.set_key_focus(this._entry);
@ -548,9 +548,7 @@ LookingGlass.prototype = {
Tweener.removeTweens(this.actor);
if (!Main.beginModal())
return;
Main.pushModal(this.actor);
global.stage.set_key_focus(this._entry);
Tweener.addTween(this.actor, { time: 0.5,
@ -567,7 +565,7 @@ LookingGlass.prototype = {
this._open = false;
Tweener.removeTweens(this.actor);
Main.endModal();
Main.popModal(this.actor);
Tweener.addTween(this.actor, { time: 0.5,
transition: "easeOutQuad",