fixed: rich native pasting caused FF to flicker

This commit is contained in:
daboe01
2016-12-09 23:45:16 +01:00
parent b966c8cb0b
commit 30c1093c2f
+7 -1
View File
@@ -2502,7 +2502,13 @@ var _CPCopyPlaceholder = '-';
[pasteboard declareTypes:[CPRTFPboardType] owner:nil];
[pasteboard setString:richtext forType:CPRTFPboardType];
[[[CPApp keyWindow] firstResponder] insertText:[[_CPRTFParser new] parseRTF:richtext]]
// prevent flickering in FF
if (CPBrowserIsEngine(CPGeckoBrowserEngine))
setTimeout(function(){
[[[CPApp keyWindow] firstResponder] insertText:[[_CPRTFParser new] parseRTF:richtext]]
}, 20);
else
[[[CPApp keyWindow] firstResponder] insertText:[[_CPRTFParser new] parseRTF:richtext]]
return false;
}