SineStriker
2023-12-18 1095dbd2fe58a73fcc086b874891bdc879a34d4d
minor tweaks
2个文件已修改
15 ■■■■ 已修改文件
src/core/contexts/cocoawindowcontext.mm 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/contexts/win32windowcontext.cpp 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/contexts/cocoawindowcontext.mm
@@ -383,9 +383,11 @@
    }
    void CocoaWindowContext::winIdChanged(QWindow *oldWindow) {
        if (windowId) {
            releaseWindowProxy(windowId);
        releaseWindowProxy(windowId);
        if (!m_windowHandle) {
            return;
        }
        windowId = m_windowHandle->winId();
        ensureWindowProxy(windowId)->setSystemTitleBarVisible(false);
        cocoaWindowEventFilter = std::make_unique<CocoaWindowEventFilter>(this, this);
src/core/contexts/win32windowcontext.cpp
@@ -117,7 +117,7 @@
    private:
        DynamicApis() {
#define DYNAMIC_API_RESOLVE(DLL, NAME)                                                             \
    p##NAME = reinterpret_cast<decltype(p##NAME)>(DLL.resolve(#NAME))
  p##NAME = reinterpret_cast<decltype(p##NAME)>(DLL.resolve(#NAME))
            QSystemLibrary user32(QStringLiteral("user32"));
            DYNAMIC_API_RESOLVE(user32, GetDpiForWindow);
@@ -332,7 +332,7 @@
    static inline quint32 getDpiForWindow(HWND hwnd) {
        const DynamicApis &apis = DynamicApis::instance();
        if (apis.pGetDpiForWindow) {         // Win10
        if (apis.pGetDpiForWindow) { // Win10
            return apis.pGetDpiForWindow(hwnd);
        } else if (apis.pGetDpiForMonitor) { // Win8.1
            HMONITOR monitor = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
@@ -893,10 +893,7 @@
    }
    void Win32WindowContext::winIdChanged(QWindow *oldWindow) {
        if (oldWindow) {
            removeManagedWindow(reinterpret_cast<HWND>(windowId));
        }
        removeManagedWindow(reinterpret_cast<HWND>(windowId));
        if (!m_windowHandle) {
            return;
        }