From 30c1093c2f6e1e04f489a3dd7190300a81bf2ef3 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Fri, 9 Dec 2016 23:45:16 +0100 Subject: [PATCH] fixed: rich native pasting caused FF to flicker --- AppKit/CPTextView/CPTextView.j | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 467618a58..8df2deb19 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -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; }