mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
UI/Qt: Pass WebContentOptions to TaskManagerWindow constructor
Previously, the browser would crash when opening a task manager window with the `--enable-qt-networking` flag set because we were passing the default WebContentOptions to the underlying WebContentView.
This commit is contained in:
parent
28b95e8ed0
commit
11039085d0
Notes:
sideshowbarker
2024-07-17 07:35:03 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/11039085d0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/549
|
@ -77,10 +77,10 @@ ErrorOr<void> Application::initialize_image_decoder()
|
|||
return {};
|
||||
}
|
||||
|
||||
void Application::show_task_manager_window()
|
||||
void Application::show_task_manager_window(WebContentOptions const& web_content_options)
|
||||
{
|
||||
if (!m_task_manager_window) {
|
||||
m_task_manager_window = new TaskManagerWindow(nullptr);
|
||||
m_task_manager_window = new TaskManagerWindow(nullptr, web_content_options);
|
||||
}
|
||||
m_task_manager_window->show();
|
||||
m_task_manager_window->activateWindow();
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
|
||||
BrowserWindow& new_window(Vector<URL::URL> const& initial_urls, WebView::CookieJar&, WebContentOptions const&, StringView webdriver_content_ipc_path, bool allow_popups, Tab* parent_tab = nullptr, Optional<u64> page_index = {});
|
||||
|
||||
void show_task_manager_window();
|
||||
void show_task_manager_window(WebContentOptions const&);
|
||||
void close_task_manager_window();
|
||||
|
||||
BrowserWindow& active_window() { return *m_active_window; }
|
||||
|
|
|
@ -349,8 +349,8 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, WebView::Cook
|
|||
task_manager_action->setIcon(load_icon_from_uri("resource://icons/16x16/app-system-monitor.png"sv));
|
||||
task_manager_action->setShortcuts({ QKeySequence("Ctrl+Shift+M") });
|
||||
inspect_menu->addAction(task_manager_action);
|
||||
QObject::connect(task_manager_action, &QAction::triggered, this, [] {
|
||||
static_cast<Ladybird::Application*>(QApplication::instance())->show_task_manager_window();
|
||||
QObject::connect(task_manager_action, &QAction::triggered, this, [&] {
|
||||
static_cast<Ladybird::Application*>(QApplication::instance())->show_task_manager_window(m_web_content_options);
|
||||
});
|
||||
|
||||
auto* debug_menu = m_hamburger_menu->addMenu("&Debug");
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
namespace Ladybird {
|
||||
|
||||
TaskManagerWindow::TaskManagerWindow(QWidget* parent)
|
||||
TaskManagerWindow::TaskManagerWindow(QWidget* parent, WebContentOptions const& web_content_options)
|
||||
: QWidget(parent, Qt::WindowFlags(Qt::WindowType::Window))
|
||||
, m_web_view(new WebContentView(this, {}, {}))
|
||||
, m_web_view(new WebContentView(this, web_content_options, {}))
|
||||
{
|
||||
setLayout(new QVBoxLayout);
|
||||
layout()->addWidget(m_web_view);
|
||||
|
|
|
@ -16,7 +16,7 @@ class TaskManagerWindow : public QWidget {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskManagerWindow(QWidget* parent);
|
||||
TaskManagerWindow(QWidget* parent, WebContentOptions const&);
|
||||
|
||||
private:
|
||||
virtual void showEvent(QShowEvent*) override;
|
||||
|
|
Loading…
Reference in a new issue