Sine Striker
2023-12-07 09287f3d9e9e88271de2bfd5388dae5a53e8c6f5
src/core/corewindowagent.cpp
@@ -21,24 +21,23 @@
    void CoreWindowAgentPrivate::init() {
    }
    bool CoreWindowAgentPrivate::setup(QWindow *window, WindowItemDelegate *delegate) {
        Q_ASSERT(window);
        if (!window) {
            return false;
        }
        auto handler =
    AbstractWindowContext *CoreWindowAgentPrivate::createContext() const {
        return
#ifdef Q_OS_WINDOWS
            new Win32WindowContext(window, delegate)
            new Win32WindowContext()
#else
            new QtWindowContext(window, delegate)
            new QtWindowContext()
#endif
            ;
        if (!handler->setup()) {
            delete handler;
                ;
    }
    bool CoreWindowAgentPrivate::setup(QObject *host, WindowItemDelegate *delegate) {
        std::unique_ptr<AbstractWindowContext> ctx(createContext());
        if (!ctx->setup(host, delegate)) {
            return false;
        }
        context.reset(handler);
        context = std::move(ctx);
        return true;
    }