From 0209d06cc48e4e40c9c54d20d7fd6314d5492a34 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <zhaoyuhang@rankyee.com> Date: ćšć, 07 12æ 2023 17:58:19 +0800 Subject: [PATCH] minor tweaks --- src/core/corewindowagent.cpp | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/core/corewindowagent.cpp b/src/core/corewindowagent.cpp index bea2239..d5dff5a 100644 --- a/src/core/corewindowagent.cpp +++ b/src/core/corewindowagent.cpp @@ -21,15 +21,20 @@ void CoreWindowAgentPrivate::init() { } - bool CoreWindowAgentPrivate::setup(QObject *host, WindowItemDelegate *delegate) { - auto ctx = + AbstractWindowContext *CoreWindowAgentPrivate::createContext() const { + return #ifdef Q_OS_WINDOWS - std::make_unique<Win32WindowContext>(host, delegate) + new Win32WindowContext() #else - std::make_unique<QtWindowContext>(host, window, delegate) + new QtWindowContext() #endif - ; - if (!ctx->setup()) { + ; + } + + + bool CoreWindowAgentPrivate::setup(QObject *host, WindowItemDelegate *delegate) { + std::unique_ptr<AbstractWindowContext> ctx(createContext()); + if (!ctx->setup(host, delegate)) { return false; } context = std::move(ctx); -- Gitblit v1.9.1