Zhao Yuhang
2025-05-07 576654b6173e97425411010b2f40b3e9519b85b8
fix possible QWKQuick crash
1个文件已修改
12 ■■■■ 已修改文件
src/quick/quickwindowagent_win.cpp 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/quick/quickwindowagent_win.cpp
@@ -47,7 +47,11 @@
    bool BorderItem::shouldEnableEmulatedPainter() const {
#  if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
        auto api = window()->rendererInterface()->graphicsApi();
        const QQuickWindow* win = window();
        if (!win) {
            return true;
        }
        auto api = win->rendererInterface()->graphicsApi();
        switch (api) {
            case QSGRendererInterface::OpenGL:
                // FIXME: experimental, try to find the exact fixed version.
@@ -97,7 +101,11 @@
    BorderItem::~BorderItem() = default;
    void BorderItem::updateGeometry() {
        setHeight(borderThickness() / window()->devicePixelRatio());
        const QQuickWindow* win = window();
        if (!win) {
            return;
        }
        setHeight(borderThickness() / win->effectiveDevicePixelRatio());
        setVisible(isNormalWindow());
    }