From e64b65a7637d4c1327e9f8b8401e3de2436748f0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 16 May 2019 13:57:19 +0900 Subject: [PATCH] fix: lagging when using tabbed window --- patches/common/chromium/.patches | 1 + .../chromium/tabbed_window_lagging.patch | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 patches/common/chromium/tabbed_window_lagging.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 945628de73284..87563427f30da 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -100,3 +100,4 @@ make_--explicitly-allowed-ports_work_with_networkservice.patch fix_crashes_in_renderframeimpl_onselectpopupmenuitem_s.patch fix_re-entracy_problem_with_invalidateframesinkid.patch chore_expose_getcontentclient_to_embedders.patch +tabbed_window_lagging.patch diff --git a/patches/common/chromium/tabbed_window_lagging.patch b/patches/common/chromium/tabbed_window_lagging.patch new file mode 100644 index 0000000000000..1538624675ac3 --- /dev/null +++ b/patches/common/chromium/tabbed_window_lagging.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Cheng Zhao +Date: Thu May 16 13:52:12 JST 2019 +Subject: tabbed_window_lagging.patch + +Fix lagging when using tabbed windows. + +Later Chromium has some enhancements on graphics code that fix the lagging +problem, but the changes are split in multiple commits on multiple files and +we can not just cherry-pick them. + +Instead I'm just using the dummy fix and it does not seem to have side effects. + +diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm +index 69c5f1f44d7e..45aba19b2390 100644 +--- a/ui/views/cocoa/bridged_native_widget.mm ++++ b/ui/views/cocoa/bridged_native_widget.mm +@@ -1037,6 +1037,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { + // BridgedNativeWidget, ui::CATransactionObserver + + bool BridgedNativeWidget::ShouldWaitInPreCommit() { ++ // Fix lagging when using tabbed windows, see the issue for more: ++ // https://github.com/electron/electron/issues/16925 ++ if (@available(macOS 10.12, *)) { ++ if ([[window_ tabbedWindows] count] > 0) ++ return false; ++ } + if (!window_visible_) + return false; + if (ca_transaction_sync_suppressed_)