mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 934470 - Cursor pin disappears on drag in textarea input, r=margaret
This commit is contained in:
parent
49274d490a
commit
0c05ef6452
@ -17,6 +17,7 @@ var SelectionHandler = {
|
||||
_cache: null,
|
||||
_activeType: 0, // TYPE_NONE
|
||||
_ignoreSelectionChanges: false, // True while user drags text selection handles
|
||||
_ignoreCompositionChanges: false, // Persist caret during IME composition updates
|
||||
|
||||
// The window that holds the selection (can be a sub-frame)
|
||||
get _contentWindow() {
|
||||
@ -108,6 +109,9 @@ var SelectionHandler = {
|
||||
this._ignoreSelectionChanges = true;
|
||||
this._moveSelection(data.handleType == this.HANDLE_TYPE_START, data.x, data.y);
|
||||
} else if (this._activeType == this.TYPE_CURSOR) {
|
||||
// Ignore IMM composition notifications when caret movement starts
|
||||
this._ignoreCompositionChanges = true;
|
||||
|
||||
// Send a click event to the text box, which positions the caret
|
||||
this._sendMouseEvents(data.x, data.y);
|
||||
|
||||
@ -133,6 +137,10 @@ var SelectionHandler = {
|
||||
}
|
||||
// Act on selectionChange notifications after handle movement ends
|
||||
this._ignoreSelectionChanges = false;
|
||||
|
||||
} else if (this._activeType == this.TYPE_CURSOR) {
|
||||
// Act on IMM composition notifications after caret movement ends
|
||||
this._ignoreCompositionChanges = false;
|
||||
}
|
||||
this._positionHandles();
|
||||
break;
|
||||
@ -158,7 +166,8 @@ var SelectionHandler = {
|
||||
break;
|
||||
|
||||
case "compositionend":
|
||||
if (this._activeType == this.TYPE_CURSOR) {
|
||||
// compositionend messages normally terminate caret display
|
||||
if (this._activeType == this.TYPE_CURSOR && !this._ignoreCompositionChanges) {
|
||||
this._deactivate();
|
||||
}
|
||||
break;
|
||||
@ -530,6 +539,7 @@ var SelectionHandler = {
|
||||
this._isRTL = false;
|
||||
this._cache = null;
|
||||
this._ignoreSelectionChanges = false;
|
||||
this._ignoreCompositionChanges = false;
|
||||
},
|
||||
|
||||
_getViewOffset: function sh_getViewOffset() {
|
||||
|
Loading…
Reference in New Issue
Block a user