electron/shell/browser/api
michal-pichlinski-openfin 2190793fe6
fix: disable background throttling also in the viz::DisplayScheduler (#38924)
* fix: disable background throttling also in the `viz::DisplayScheduler`

`viz::DisplayScheduler` is responsible for drawing and swapping frames
in the `DisplayScheduler::DrawAndSwap` which is called from the
`DisplayScheduler::AttemptDrawAndSwap` if the `DisplayScheduler::ShouldDraw`
returns true. `ShouldDraw` depends on the `DisplayScheduler` visibility
and when it is not visible then it returns false.

In order to keep producing frames, disabling `backgroundThrottling`
should also prevent changing `DisplayScheduler` visibility to false.

`DisplayScheduler` lives in the `ui::Compositor` where every
`electron::NativewWindow` has its own `Compositor`. `electron::NativewWindow`
may be host of the multiple `electron::api::WebContents` instances which may
have different `WebPreferences` settings. Therefore if at least one
of the `WebContents` requires disabling throttling then all other `WebContents`
using the same window will have it disabled in the `ui::Compositor`.

BREAKING CHANGE:
`backgroundThrottling` set to false will disable frames throttling
in the `BrowserWindow` for all `WebContents` displayed by it.

Close: [#31016](https://github.com/electron/electron/issues/31016)

* fixup! fix: disable background throttling also in the `viz::DisplayScheduler`

* fixup! fix: disable background throttling also in the `viz::DisplayScheduler`

* fixup! fix: disable background throttling also in the `viz::DisplayScheduler`

---------

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-09-26 16:00:46 -04:00
..
views chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
electron_api_app.cc fix: app.runningUnderARM64Translation() always returning true on Windows ARM64 (#39920) 2023-09-20 16:15:19 -04:00
electron_api_app.h chore: bump chromium to 117.0.5897.0 (main) (#39147) 2023-07-20 09:36:59 +02:00
electron_api_app_mac.mm chore: bump chromium to 110.0.5415.0 (main) (#36186) 2022-11-17 14:59:23 -05:00
electron_api_app_mas.mm chore: bump chromium to 117.0.5923.0 (main) (#39304) 2023-08-04 10:47:29 +02:00
electron_api_auto_updater.cc feat: add new ElectronSquirrelPreventDowngrades flag (#38625) 2023-09-11 11:54:51 -07:00
electron_api_auto_updater.h feat: add new ElectronSquirrelPreventDowngrades flag (#38625) 2023-09-11 11:54:51 -07:00
electron_api_base_window.cc fix: ensure BrowserView bounds are always relative to window (#39605) 2023-08-23 09:55:31 -04:00
electron_api_base_window.h feat: browserWindow.getBrowserViews() to return sorted by z-index array (#38943) 2023-07-11 11:01:30 +02:00
electron_api_browser_view.cc fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_browser_view.h fix: ensure BrowserView bounds are always relative to window (#39605) 2023-08-23 09:55:31 -04:00
electron_api_browser_window.cc fix: frameless mica/acrylic windows (#39708) 2023-09-11 14:51:54 +02:00
electron_api_browser_window.h chore: remove unused std includes (#38767) 2023-06-14 11:07:18 -07:00
electron_api_content_tracing.cc chore: make contentTracing.stopRecording() failure clearer (#38488) 2023-05-31 09:54:41 -04:00
electron_api_cookies.cc perf: prefer base::StringPiece over std::string for build-time strings (#38717) 2023-06-12 09:55:22 +02:00
electron_api_cookies.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_crash_reporter.cc chore: bump chromium to 116.0.5829.0 (main) (#38726) 2023-06-13 14:45:48 -04:00
electron_api_crash_reporter.h chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
electron_api_data_pipe_holder.cc chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_data_pipe_holder.h chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
electron_api_debugger.cc chore: remove unused std includes (#38767) 2023-06-14 11:07:18 -07:00
electron_api_debugger.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_desktop_capturer.cc chore: bump chromium to 118.0.5991.0 (main) (#39714) 2023-09-05 21:17:56 -04:00
electron_api_desktop_capturer.h fix: use StartUpdating method for PipeWire capturer (#38833) 2023-07-11 10:21:11 +02:00
electron_api_dialog.cc refactor: add gin_helper::Dictionary::CreateEmpty() helper (#39547) 2023-08-21 10:43:41 +09:00
electron_api_download_item.cc chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
electron_api_download_item.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_event_emitter.cc chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
electron_api_event_emitter.h
electron_api_global_shortcut.cc chore: bump chromium to 117.0.5852.0 (main) (#38891) 2023-07-01 16:22:55 -04:00
electron_api_global_shortcut.h chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
electron_api_in_app_purchase.cc chore: remove obsolete "simple" object annotations for the remote module (#39486) 2023-08-22 13:43:30 +09:00
electron_api_in_app_purchase.h chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
electron_api_menu.cc fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_menu.h fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_menu_mac.h chore: cleanup arc migration helpers (#39606) 2023-08-23 09:54:21 -04:00
electron_api_menu_mac.mm chore: bump chromium to 117.0.5892.0 (main) (#39118) 2023-07-19 00:26:27 +02:00
electron_api_menu_views.cc feat: add support for keyboard initialized menu popup (#38903) 2023-06-29 15:54:06 -07:00
electron_api_menu_views.h feat: add support for keyboard initialized menu popup (#38903) 2023-06-29 15:54:06 -07:00
electron_api_native_theme.cc chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
electron_api_native_theme.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_native_theme_mac.mm chore: cleanup arc migration helpers (#39606) 2023-08-23 09:54:21 -04:00
electron_api_net.cc chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
electron_api_net_log.cc chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
electron_api_net_log.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_notification.cc refactor: add gin_helper::Dictionary::CreateEmpty() helper (#39547) 2023-08-21 10:43:41 +09:00
electron_api_notification.h fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_power_monitor.cc feat: add thermal states to powerMonitor (#37935) 2023-04-19 11:46:55 +02:00
electron_api_power_monitor.h feat: add thermal states to powerMonitor (#37935) 2023-04-19 11:46:55 +02:00
electron_api_power_monitor_mac.mm chore: bump chromium to 117.0.5923.0 (main) (#39304) 2023-08-04 10:47:29 +02:00
electron_api_power_monitor_win.cc chore: drop support for Windows 7 / 8 / 8.1 (#36427) 2022-11-30 17:13:29 -08:00
electron_api_power_save_blocker.cc refactor: prefer base::Contains() over find() + end() (#38443) 2023-05-30 10:28:43 +02:00
electron_api_power_save_blocker.h refactor: prefer base::Contains() over find() + end() (#38443) 2023-05-30 10:28:43 +02:00
electron_api_printing.cc chore: remove deprecated webContents.getPrinters() (#39663) 2023-09-05 10:16:41 +02:00
electron_api_protocol.cc fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_protocol.h fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_push_notifications.cc chore: remove unused std includes (#38767) 2023-06-14 11:07:18 -07:00
electron_api_push_notifications.h chore: use nested namespaces (#37855) 2023-04-11 15:30:25 +09:00
electron_api_push_notifications_mac.mm chore: cleanup arc migration helpers (#39606) 2023-08-23 09:54:21 -04:00
electron_api_safe_storage.cc feat: expose safestorage backend information on linux (#38873) 2023-07-13 11:14:33 +02:00
electron_api_safe_storage.h chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
electron_api_screen.cc fix: sync api::Screen wrapper method sigs to upstream (#38597) 2023-06-07 09:28:50 +02:00
electron_api_screen.h fix: sync api::Screen wrapper method sigs to upstream (#38597) 2023-06-07 09:28:50 +02:00
electron_api_service_worker_context.cc chore: remove unused std includes (#38767) 2023-06-14 11:07:18 -07:00
electron_api_service_worker_context.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_session.cc fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_session.h fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_system_preferences.cc feat: expose app accessibility transparency settings api (#39631) 2023-09-20 12:48:02 -07:00
electron_api_system_preferences.h feat: expose app accessibility transparency settings api (#39631) 2023-09-20 12:48:02 -07:00
electron_api_system_preferences_mac.mm feat: expose app accessibility transparency settings api (#39631) 2023-09-20 12:48:02 -07:00
electron_api_system_preferences_win.cc chore: remove deprecated systemPreferences color scheme events (#39341) 2023-08-14 10:37:18 +02:00
electron_api_tray.cc fix: potential crash calling tray.popUpContextMenu() (#39231) 2023-08-01 15:07:30 +09:00
electron_api_tray.h fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_url_loader.cc refactor: add gin_helper::Dictionary::CreateEmpty() helper (#39547) 2023-08-21 10:43:41 +09:00
electron_api_url_loader.h chore: bump chromium to 117.0.5852.0 (main) (#38891) 2023-07-01 16:22:55 -04:00
electron_api_utility_process.cc chore: fix clang-tidy warnings (#38079) 2023-04-26 10:09:54 -04:00
electron_api_utility_process.h chore: remove unused std includes (#38767) 2023-06-14 11:07:18 -07:00
electron_api_view.cc chore: remove unused electron::api::View code (#38561) 2023-06-03 10:40:44 -05:00
electron_api_view.h chore: remove unused electron::api::View code (#38561) 2023-06-03 10:40:44 -05:00
electron_api_web_contents.cc fix: disable background throttling also in the viz::DisplayScheduler (#38924) 2023-09-26 16:00:46 -04:00
electron_api_web_contents.h fix: disable background throttling also in the viz::DisplayScheduler (#38924) 2023-09-26 16:00:46 -04:00
electron_api_web_contents_impl.cc build: remove enable_osr build flag (#38703) 2023-06-13 14:48:53 -04:00
electron_api_web_contents_mac.mm chore: bump chromium to 118.0.5975.0 (main) (#39531) 2023-09-01 15:54:59 +09:00
electron_api_web_contents_view.cc chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_web_contents_view.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_web_frame_main.cc chore: remove deprecated ipcRenderer.sendTo() (#39087) 2023-08-28 10:29:27 -04:00
electron_api_web_frame_main.h fix: set prototype names on gin::Constructible classes (#39006) 2023-07-10 11:49:20 +02:00
electron_api_web_request.cc refactor: use constexpr lookup tables in gin helper (#38818) 2023-06-19 10:33:09 +02:00
electron_api_web_request.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
electron_api_web_view_manager.cc chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
frame_subscriber.cc chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
frame_subscriber.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
gpu_info_enumerator.cc chore: fix clang-tidy warnings (#38079) 2023-04-26 10:09:54 -04:00
gpu_info_enumerator.h chore: modernize ListValue usage in gpu info (#34663) 2022-06-28 09:52:59 -07:00
gpuinfo_manager.cc chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
gpuinfo_manager.h chore: remove unused std includes (#38767) 2023-06-14 11:07:18 -07:00
message_port.cc refactor: prefer base::Contains() over find() + end() (#38443) 2023-05-30 10:28:43 +02:00
message_port.h fix: destroy message port backend when JS env exits (#39335) 2023-08-03 14:30:19 +02:00
process_metric.cc refactor: change defined(MAS_BUILD) to IS_MAS_BUILD() (#36332) 2022-11-14 12:46:52 -08:00
process_metric.h
save_page_handler.cc chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
save_page_handler.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
ui_event.cc chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
ui_event.h chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00