refactor: Make Args less of a singleton (#5041)
This means it's no longer a singleton, and its lifetime is bound to our application. This felt like a good small experiment to see how its changes would look if we did this. As a shortcut, `getApp` that is already a mega singleton keeps a reference to Args, this means places that are a bit more difficult to inject into call `getApp()->getArgs()` just like other things are accessed.
This commit is contained in:
@@ -64,13 +64,13 @@ bool FramelessEmbedWindow::nativeEvent(const QByteArray &eventType,
|
||||
|
||||
void FramelessEmbedWindow::showEvent(QShowEvent *)
|
||||
{
|
||||
if (!getArgs().parentWindowId)
|
||||
if (!getApp()->getArgs().parentWindowId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto parentHwnd =
|
||||
reinterpret_cast<HWND>(getArgs().parentWindowId.value()))
|
||||
reinterpret_cast<HWND>(getApp()->getArgs().parentWindowId.value()))
|
||||
{
|
||||
auto handle = reinterpret_cast<HWND>(this->winId());
|
||||
if (!::SetParent(handle, parentHwnd))
|
||||
|
||||
Reference in New Issue
Block a user