From 29901fc2a97eedd3c914f807d1819c9ea7e69973 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周一, 25 12月 2023 17:53:34 +0800 Subject: [PATCH] Optimize Windows 10 border handling --- src/core/contexts/win32windowcontext_p.h | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/core/contexts/win32windowcontext_p.h b/src/core/contexts/win32windowcontext_p.h index 3d2649e..baa0254 100644 --- a/src/core/contexts/win32windowcontext_p.h +++ b/src/core/contexts/win32windowcontext_p.h @@ -1,6 +1,15 @@ #ifndef WIN32WINDOWCONTEXT_P_H #define WIN32WINDOWCONTEXT_P_H +// +// W A R N I N G !!! +// ----------------- +// +// This file is not part of the QWindowKit API. It is used purely as an +// implementation detail. This header file may change from version to +// version without notice, or may even be removed. +// + #include <QWKCore/qwindowkit_windows.h> #include <QWKCore/private/abstractwindowcontext_p.h> @@ -26,11 +35,10 @@ QString key() const override; void virtual_hook(int id, void *data) override; - bool needBorderPainter() const; - int borderThickness() const; - protected: - void winIdChanged(QWindow *oldWindow, bool destroyed) override; + void winIdChanged() override; + bool windowAttributeChanged(const QString &key, const QVariant &attribute, + const QVariant &oldAttribute) override; public: bool windowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); @@ -51,6 +59,11 @@ bool nonClientCalcSizeHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); + public: + bool needBorderPainter() const; + + int borderThickness() const; + protected: WId windowId = 0; @@ -62,6 +75,8 @@ bool mouseLeaveBlocked = false; bool centered = false; + + bool hasExtraMargins = false; }; } -- Gitblit v1.9.1