SineStriker
2023-12-20 3871bfc5d3aff45e498fa2944c27e6eb5d146c8e
src/core/contexts/qtwindowcontext.cpp
@@ -244,17 +244,24 @@
    }
    void QtWindowContext::virtual_hook(int id, void *data) {
        switch (id) {
            case ShowSystemMenuHook:
                return;
            default:
                break;
        }
        AbstractWindowContext::virtual_hook(id, data);
    }
    void QtWindowContext::winIdChanged(QWindow *oldWindow) {
        Q_UNUSED(oldWindow)
    void QtWindowContext::winIdChanged(QWindow *oldWindow, bool isDestroyed) {
        Q_UNUSED(isDestroyed)
        // If the original window id is valid, remove all resources related
        if (oldWindow) {
            qtWindowEventFilter.reset();
        }
        if (!m_windowHandle) {
            m_delegate->setWindowFlags(m_host, m_delegate->getWindowFlags(m_host) &
                                                   ~Qt::FramelessWindowHint);
            return;
        }
        // Allocate new resources
        m_delegate->setWindowFlags(m_host,
                                   m_delegate->getWindowFlags(m_host) | Qt::FramelessWindowHint);
        qtWindowEventFilter = std::make_unique<QtWindowEventFilter>(this);