Layout: show the OSK on the monitor where the focused window lives

In multimonitor scenarios, it makes sense to show the OSK close to
the window that will actually receive keystrokes.

https://bugzilla.gnome.org/show_bug.cgi?id=685856
This commit is contained in:
Giovanni Campagna
2012-10-14 18:57:45 +02:00
parent 00201f7e6c
commit 8a7c0313f6
3 changed files with 101 additions and 37 deletions

View File

@ -1471,6 +1471,7 @@ const MessageTray = new Lang.Class({
this._pointerInTray = false;
this._pointerInKeyboard = false;
this._keyboardVisible = false;
this._keyboardUnderMessageTray = false;
this._summaryState = State.HIDDEN;
this._pointerInSummary = false;
this._notificationClosed = false;
@ -1924,12 +1925,15 @@ const MessageTray = new Lang.Class({
},
_onKeyboardVisibleChanged: function(layoutManager, keyboardVisible) {
if (this._keyboardVisible == keyboardVisible)
let keyboardUnderMessageTray = layoutManager.keyboardIndex == layoutManager.bottomIndex;
if (this._keyboardVisible == keyboardVisible &&
this._keyboardUnderMesssageTray == keyboardUnderMessageTray)
return;
this._keyboardVisible = keyboardVisible;
this._keyboardUnderMessageTray = keyboardUnderMessageTray;
if (keyboardVisible)
if (keyboardVisible && keyboardUnderMessageTray)
this.actor.add_style_pseudo_class('keyboard');
else
this.actor.remove_style_pseudo_class('keyboard');
@ -2086,12 +2090,12 @@ const MessageTray = new Lang.Class({
this._desktopCloneState == State.SHOWN);
let desktopCloneShouldBeVisible = (trayShouldBeVisible &&
!this._overviewVisible &&
!this._keyboardVisible);
(!this._keyboardVisible || !this._keyboardUnderMessageTray));
if (!desktopCloneIsVisible && desktopCloneShouldBeVisible) {
this._showDesktopClone();
} else if (desktopCloneIsVisible && !desktopCloneShouldBeVisible) {
this._hideDesktopClone (this._keyboardVisible);
this._hideDesktopClone (this._keyboardVisible && this._keyboardUnderMessageTray);
}
},