viewSelector: Don't reset the search entry if it has preedit text

If users click outside the search entry while it's empty we reset and
thus give up key focus. This means that when using an input method
with candidate popups, interacting with the popup with a mouse click
cancels the current input method context if there's no other text in
the entry besides the preedit string.

To avoid this we can check if the entry has preedit in addition to
checking if it has normal text.

https://bugzilla.gnome.org/show_bug.cgi?id=745167
This commit is contained in:
Rui Matos
2015-02-26 19:21:52 +01:00
parent 3ec764d584
commit b58f08bda1
3 changed files with 21 additions and 1 deletions

View File

@ -552,7 +552,9 @@ const ViewSelector = new Lang.Class({
_onCapturedEvent: function(actor, event) {
if (event.type() == Clutter.EventType.BUTTON_PRESS) {
let source = event.get_source();
if (source != this._text && this._text.text == '' &&
if (source != this._text &&
this._text.text == '' &&
!this._text.has_preedit () &&
!Main.layoutManager.keyboardBox.contains(source)) {
// the user clicked outside after activating the entry, but
// with no search term entered and no keyboard button pressed