| | |
| | | #include <QtCore/QHash> |
| | | #include <QtCore/QScopeGuard> |
| | | #include <QtGui/QGuiApplication> |
| | | #include <QtGui/QPainter> |
| | | |
| | | #include <QtCore/private/qsystemlibrary_p.h> |
| | | #include <QtGui/private/qhighdpiscaling_p.h> |
| | |
| | | #include <shellscalingapi.h> |
| | | #include <dwmapi.h> |
| | | #include <timeapi.h> |
| | | #include <versionhelpers.h> |
| | | |
| | | #include "nativeeventfilter.h" |
| | | |
| | |
| | | } |
| | | |
| | | static inline bool isWin8OrGreater() { |
| | | static const bool result = ::IsWindows8OrGreater(); |
| | | static const bool result = IsWindows8OrGreater_Real(); |
| | | return result; |
| | | } |
| | | |
| | | static inline bool isWin8Point1OrGreater() { |
| | | static const bool result = ::IsWindows8Point1OrGreater(); |
| | | static const bool result = IsWindows8Point1OrGreater_Real(); |
| | | return result; |
| | | } |
| | | |
| | | static inline bool isWin10OrGreater() { |
| | | static const bool result = ::IsWindows10OrGreater(); |
| | | static const bool result = IsWindows10OrGreater_Real(); |
| | | return result; |
| | | } |
| | | |
| | | static inline bool isWin11OrGreater() { |
| | | static const bool result = ::IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN10), |
| | | LOBYTE(_WIN32_WINNT_WIN10), 22000); |
| | | static const bool result = IsWindows11OrGreater_Real(); |
| | | return result; |
| | | } |
| | | |
| | |
| | | m_delegate->isHostSizeFixed(m_host)); |
| | | return; |
| | | } |
| | | case NeedsDrawBordersHook: { |
| | | auto &result = *reinterpret_cast<bool *>(data); |
| | | result = isWin10OrGreater() && !isWin11OrGreater(); |
| | | return; |
| | | } |
| | | case DrawBordersHook: { |
| | | auto a = reinterpret_cast<void **>(data); |
| | | auto &painter = *reinterpret_cast<QPainter *>(a[0]); |
| | | auto &rect = *reinterpret_cast<const QRect *>(a[1]); |
| | | auto ®ion = *reinterpret_cast<const QRegion *>(a[2]); |
| | | |
| | | qDebug() << "paint" << &painter << rect << region; |
| | | |
| | | // TODO: Draw border |
| | | // ... |
| | | |
| | | break; |
| | | } |
| | | default: |
| | | break; |
| | | } |