mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWebView+UI: Do not create a QApplication in headless mode
This is causing errors on the WPT runner, which does not have a display output. To do this requires shuffling around the Main::Arguments struct, as we now need access to it from overridden WebView::Application methods after construction.
This commit is contained in:
parent
f66cac3417
commit
fa164083fd
Notes:
github-actions[bot]
2025-06-10 22:11:59 +00:00
Author: https://github.com/trflynn89
Commit: fa164083fd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5051
Reviewed-by: https://github.com/tcl3 ✅
6 changed files with 64 additions and 49 deletions
|
@ -72,9 +72,9 @@ public:
|
|||
|
||||
protected:
|
||||
template<DerivedFrom<Application> ApplicationType>
|
||||
static NonnullOwnPtr<ApplicationType> create(Main::Arguments& arguments)
|
||||
static NonnullOwnPtr<ApplicationType> create(Main::Arguments const& arguments)
|
||||
{
|
||||
auto app = adopt_own(*new ApplicationType { {}, arguments });
|
||||
auto app = adopt_own(*new ApplicationType { {} });
|
||||
app->initialize(arguments);
|
||||
|
||||
return app;
|
||||
|
@ -90,6 +90,8 @@ protected:
|
|||
|
||||
virtual Optional<ByteString> ask_user_for_download_folder() const { return {}; }
|
||||
|
||||
Main::Arguments& arguments() { return m_arguments; }
|
||||
|
||||
private:
|
||||
void initialize(Main::Arguments const& arguments);
|
||||
|
||||
|
@ -134,6 +136,7 @@ private:
|
|||
Settings m_settings;
|
||||
OwnPtr<ApplicationSettingsObserver> m_settings_observer;
|
||||
|
||||
Main::Arguments m_arguments;
|
||||
BrowserOptions m_browser_options;
|
||||
WebContentOptions m_web_content_options;
|
||||
|
||||
|
@ -157,16 +160,16 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#define WEB_VIEW_APPLICATION(ApplicationType) \
|
||||
public: \
|
||||
static NonnullOwnPtr<ApplicationType> create(Main::Arguments& arguments) \
|
||||
{ \
|
||||
return WebView::Application::create<ApplicationType>(arguments); \
|
||||
} \
|
||||
\
|
||||
static ApplicationType& the() \
|
||||
{ \
|
||||
return static_cast<ApplicationType&>(WebView::Application::the()); \
|
||||
} \
|
||||
\
|
||||
ApplicationType(Badge<WebView::Application>, Main::Arguments&);
|
||||
#define WEB_VIEW_APPLICATION(ApplicationType) \
|
||||
public: \
|
||||
static NonnullOwnPtr<ApplicationType> create(Main::Arguments const& arguments) \
|
||||
{ \
|
||||
return WebView::Application::create<ApplicationType>(arguments); \
|
||||
} \
|
||||
\
|
||||
static ApplicationType& the() \
|
||||
{ \
|
||||
return static_cast<ApplicationType&>(WebView::Application::the()); \
|
||||
} \
|
||||
\
|
||||
ApplicationType(Badge<WebView::Application>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue