mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 931904 - Ignore selections coming from the autocomplete code in urlbarBindings; r=gavin
This commit is contained in:
parent
af3af9a806
commit
4b909f5b3d
@ -59,6 +59,7 @@
|
||||
this.timeout = this._prefs.getIntPref("delay");
|
||||
this._formattingEnabled = this._prefs.getBoolPref("formatting.enabled");
|
||||
this._mayTrimURLs = this._prefs.getBoolPref("trimURLs");
|
||||
this._ignoreNextSelect = false;
|
||||
|
||||
this.inputField.controllers.insertControllerAt(0, this._copyCutController);
|
||||
this.inputField.addEventListener("mousedown", this, false);
|
||||
@ -678,6 +679,15 @@
|
||||
this.setAttribute("actiontype", action.type);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="selectTextRange">
|
||||
<parameter name="aStartIndex"/>
|
||||
<parameter name="aEndIndex"/>
|
||||
<body><![CDATA[
|
||||
this._ignoreNextSelect = true;
|
||||
this.inputField.setSelectionRange(aStartIndex, aEndIndex);
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
<handlers>
|
||||
@ -739,6 +749,15 @@
|
||||
<handler event="dragover" phase="capturing" action="this.onDragOver(event, this);"/>
|
||||
<handler event="drop" phase="capturing" action="this.onDrop(event, this);"/>
|
||||
<handler event="select"><![CDATA[
|
||||
if (this._ignoreNextSelect) {
|
||||
// If this select event is coming from autocomplete's selectTextRange,
|
||||
// then we don't need to adjust what's on the selection keyboard here,
|
||||
// but make sure to reset the flag since this should be a one-time
|
||||
// suppression.
|
||||
this._ignoreNextSelect = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Cc["@mozilla.org/widget/clipboard;1"]
|
||||
.getService(Ci.nsIClipboard)
|
||||
.supportsSelectionClipboard())
|
||||
|
Loading…
Reference in New Issue
Block a user