UI/Qt: Set WC's max FPS to the refresh rate of the current screen

This commit is contained in:
Luke Wilde 2025-07-25 16:43:27 +01:00 committed by Alexander Kalenik
commit 124bdce99c
Notes: github-actions[bot] 2025-07-26 14:10:29 +00:00
5 changed files with 40 additions and 4 deletions

View file

@ -56,7 +56,11 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_layout->setSpacing(0);
m_layout->setContentsMargins(0, 0, 0, 0);
m_view = new WebContentView(this, parent_client, page_index);
auto view_initial_state = WebContentViewInitialState {
.maximum_frames_per_second = window->refresh_rate(),
};
m_view = new WebContentView(this, parent_client, page_index, AK::move(view_initial_state));
m_find_in_page = new FindInPageWidget(this, m_view);
m_find_in_page->setVisible(false);
m_toolbar = new QToolBar(this);