Adapt for building with MinGW and 64-bit
This commit is contained in:
parent
b1d00d0b28
commit
e5a527b5ef
3 changed files with 22 additions and 6 deletions
|
|
@ -36,7 +36,7 @@ void IgnoreAllActivation(not_null<QWidget*> widget) {
|
||||||
Assert(handle != nullptr);
|
Assert(handle != nullptr);
|
||||||
|
|
||||||
ShowWindow(handle, SW_HIDE);
|
ShowWindow(handle, SW_HIDE);
|
||||||
const auto style = GetWindowLong(handle, GWL_EXSTYLE);
|
const auto style = GetWindowLongPtr(handle, GWL_EXSTYLE);
|
||||||
SetWindowLong(
|
SetWindowLong(
|
||||||
handle,
|
handle,
|
||||||
GWL_EXSTYLE,
|
GWL_EXSTYLE,
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,22 @@
|
||||||
|
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
|
|
||||||
|
// WM_POINTER support from Windows 8 onwards (WINVER >= 0x0602)
|
||||||
|
#ifndef WM_POINTERUPDATE
|
||||||
|
# define WM_NCPOINTERUPDATE 0x0241
|
||||||
|
# define WM_NCPOINTERDOWN 0x0242
|
||||||
|
# define WM_NCPOINTERUP 0x0243
|
||||||
|
# define WM_POINTERUPDATE 0x0245
|
||||||
|
# define WM_POINTERDOWN 0x0246
|
||||||
|
# define WM_POINTERUP 0x0247
|
||||||
|
# define WM_POINTERENTER 0x0249
|
||||||
|
# define WM_POINTERLEAVE 0x024A
|
||||||
|
# define WM_POINTERACTIVATE 0x024B
|
||||||
|
# define WM_POINTERCAPTURECHANGED 0x024C
|
||||||
|
# define WM_POINTERWHEEL 0x024E
|
||||||
|
# define WM_POINTERHWHEEL 0x024F
|
||||||
|
#endif // WM_POINTERUPDATE
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
@ -197,7 +213,7 @@ void WindowShadow::init(QColor color) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ShadowByHandle.emplace(_handles[i], this);
|
ShadowByHandle.emplace(_handles[i], this);
|
||||||
SetWindowLong(_handles[i], GWL_HWNDPARENT, (LONG)_handle);
|
SetWindowLongPtr(_handles[i], GWLP_HWNDPARENT, (LONG)_handle);
|
||||||
|
|
||||||
_contexts[i] = CreateCompatibleDC(_screenContext);
|
_contexts[i] = CreateCompatibleDC(_screenContext);
|
||||||
if (!_contexts[i]) {
|
if (!_contexts[i]) {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ bool WindowHelper::NativeFilter::nativeEventFilter(
|
||||||
msg->message,
|
msg->message,
|
||||||
msg->wParam,
|
msg->wParam,
|
||||||
msg->lParam,
|
msg->lParam,
|
||||||
static_cast<LRESULT*>(result))
|
reinterpret_cast<LRESULT*>(result))
|
||||||
: false;
|
: false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -269,7 +269,7 @@ bool WindowHelper::handleNativeEvent(
|
||||||
} return false;
|
} return false;
|
||||||
|
|
||||||
case WM_SHOWWINDOW: {
|
case WM_SHOWWINDOW: {
|
||||||
const auto style = GetWindowLong(_handle, GWL_STYLE);
|
const auto style = GetWindowLongPtr(_handle, GWL_STYLE);
|
||||||
const auto changes = WindowShadow::Change::Resized
|
const auto changes = WindowShadow::Change::Resized
|
||||||
| ((wParam && !(style & (WS_MAXIMIZE | WS_MINIMIZE)))
|
| ((wParam && !(style & (WS_MAXIMIZE | WS_MINIMIZE)))
|
||||||
? WindowShadow::Change::Shown
|
? WindowShadow::Change::Shown
|
||||||
|
|
@ -375,8 +375,8 @@ void WindowHelper::updateMargins() {
|
||||||
GetClientRect(_handle, &r);
|
GetClientRect(_handle, &r);
|
||||||
a = r;
|
a = r;
|
||||||
|
|
||||||
const auto style = GetWindowLong(_handle, GWL_STYLE);
|
const auto style = GetWindowLongPtr(_handle, GWL_STYLE);
|
||||||
const auto styleEx = GetWindowLong(_handle, GWL_EXSTYLE);
|
const auto styleEx = GetWindowLongPtr(_handle, GWL_EXSTYLE);
|
||||||
AdjustWindowRectEx(&a, style, false, styleEx);
|
AdjustWindowRectEx(&a, style, false, styleEx);
|
||||||
auto margins = QMargins(
|
auto margins = QMargins(
|
||||||
a.left - r.left,
|
a.left - r.left,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue