| | |
| | | cmake_minimum_required(VERSION 3.17) |
| | | |
| | | project(QWindowKit VERSION 2.5.1.1 LANGUAGES CXX) |
| | | project(QWindowKit VERSION 1.0.1.0 LANGUAGES CXX) |
| | | |
| | | # ---------------------------------- |
| | | # Build Options |
| | |
| | | } |
| | | |
| | | QVariant Win32WindowContext::windowAttribute(const QString &key) const { |
| | | if (key == QStringLiteral("title-bar-rect")) { |
| | | if (key == QStringLiteral("window-rect")) { |
| | | if (!m_windowHandle) |
| | | return {}; |
| | | |
| | |
| | | } else { |
| | | ::AdjustWindowRectEx(&frame, style, FALSE, exStyle); |
| | | } |
| | | frame.left = std::abs(frame.left); |
| | | frame.top = std::abs(frame.top); |
| | | frame.right = std::abs(frame.right); |
| | | frame.bottom = std::abs(frame.bottom); |
| | | return QVariant::fromValue(rect2qrect(frame)); |
| | | } |
| | | |
| | |
| | | // When the window is inactive, there is a transparency bug in the top |
| | | // border, and we need to extend the non-client area to the whole title |
| | | // bar. |
| | | QRect frame = ctx->windowAttribute(QStringLiteral("title-bar-rect")).toRect(); |
| | | QMargins margins{0, frame.top(), 0, 0}; |
| | | QRect frame = ctx->windowAttribute(QStringLiteral("window-rect")).toRect(); |
| | | QMargins margins{0, -frame.top(), 0, 0}; |
| | | ctx->setWindowAttribute(QStringLiteral("extra-margins"), QVariant::fromValue(margins)); |
| | | } |
| | | |