mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 20:27:58 +01:00
Fallback to useable clipboard on Windows. Closes issue #690.
This commit is contained in:
@@ -378,10 +378,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
* @optional
|
* @optional
|
||||||
*/
|
*/
|
||||||
clipboardWrite: function clipboardWrite(str, verbose, which) {
|
clipboardWrite: function clipboardWrite(str, verbose, which) {
|
||||||
if (which == null)
|
if (which == null || which == "selection" && !services.clipboard.supportsSelectionClipboard())
|
||||||
services.clipboardHelper.copyString(str);
|
services.clipboardHelper.copyString(str);
|
||||||
else if (which == "selection" && !services.clipboard.supportsSelectionClipboard())
|
|
||||||
return;
|
|
||||||
else
|
else
|
||||||
services.clipboardHelper.copyStringToClipboard(str,
|
services.clipboardHelper.copyStringToClipboard(str,
|
||||||
services.clipboard["k" + util.capitalize(which) + "Clipboard"]);
|
services.clipboard["k" + util.capitalize(which) + "Clipboard"]);
|
||||||
|
|||||||
@@ -1518,13 +1518,18 @@ var Buffer = Module("Buffer", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_exWidth: function _exWidth(elem) {
|
_exWidth: function _exWidth(elem) {
|
||||||
let div = DOM(<elem style="width: 1ex !important; position: absolute !important; padding: 0 !important; display: block;"/>,
|
|
||||||
elem.ownerDocument).appendTo(elem.body || elem);
|
|
||||||
try {
|
try {
|
||||||
return parseFloat(div.style.width);
|
let div = DOM(<elem style="width: 1ex !important; position: absolute !important; padding: 0 !important; display: block;"/>,
|
||||||
|
elem.ownerDocument).appendTo(elem.body || elem);
|
||||||
|
try {
|
||||||
|
return parseFloat(div.style.width);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
div.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finally {
|
catch (e) {
|
||||||
div.remove();
|
return parseFloat(DOM(elem).fontSize) / 1.618;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user