From 9a8aa5c349899dd0143c0cece61fd0880f21ff31 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@unixuser.org>
Date: Tue, 21 Aug 2012 18:04:55 +0900
Subject: [PATCH] keyboard: prevent focus lose when extended keys are hidden

"key-focus-changed" handler assumes that a key actor keeps focus
until the extended keys boxpointer is hidden.  However, popModal
in Key._ungrab resets the focus to the stage, and thus the entire
keyboard is hidden after key press.  This patch makes sure to set
the key focus to the trigger key actor before pushModal.

https://bugzilla.gnome.org/show_bug.cgi?id=674955
---
 js/ui/keyboard.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index fcacc50..5d2c9e1 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -178,6 +178,7 @@ const Key = new Lang.Class({
             this._boxPointer.show(BoxPointer.PopupAnimation.FULL);
             this.actor.set_hover(false);
             if (!this._grabbed) {
+                 global.stage.set_key_focus(this.actor);
                  Main.pushModal(this.actor);
                  this._eventCaptureId = global.stage.connect('captured-event', Lang.bind(this, this._onEventCapture));
                  this._grabbed = true;
-- 
1.7.11.4