parent
b9b2e54427
commit
973435e5df
|
@ -300,7 +300,7 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType,
|
|||
break;
|
||||
}
|
||||
case WM_THEMECHANGED: {
|
||||
data->themeEnabled = IsThemeActive();
|
||||
handleThemeChanged(data);
|
||||
break;
|
||||
}
|
||||
case WM_WINDOWPOSCHANGED: {
|
||||
|
@ -360,6 +360,7 @@ void WinNativeEventFilter::init(LPWINDOW data) {
|
|||
SetLayeredWindowAttributes(data->hwnd, RGB(255, 0, 255), 0, LWA_COLORKEY);
|
||||
// Make sure our window has the frame shadow.
|
||||
handleDwmCompositionChanged(data);
|
||||
handleThemeChanged(data);
|
||||
// Tell the window to redraw itself.
|
||||
SetWindowPos(data->hwnd, nullptr, 0, 0, 0, 0,
|
||||
SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE |
|
||||
|
@ -444,6 +445,10 @@ void WinNativeEventFilter::handleDwmCompositionChanged(LPWINDOW data) {
|
|||
updateRegion(data);
|
||||
}
|
||||
|
||||
void WinNativeEventFilter::handleThemeChanged(LPWINDOW data) {
|
||||
data->themeEnabled = IsThemeActive();
|
||||
}
|
||||
|
||||
UINT WinNativeEventFilter::getDpiForWindow(HWND handle) const {
|
||||
const auto getScreenDpi = [this]() -> UINT {
|
||||
// Available since Windows 7.
|
||||
|
|
|
@ -38,6 +38,7 @@ private:
|
|||
void init(LPWINDOW data);
|
||||
void updateRegion(LPWINDOW data);
|
||||
void handleDwmCompositionChanged(LPWINDOW data);
|
||||
void handleThemeChanged(LPWINDOW data);
|
||||
UINT getDpiForWindow(HWND handle) const;
|
||||
qreal getDprForWindow(HWND handle) const;
|
||||
int getSystemMetricsForWindow(HWND handle, int index) const;
|
||||
|
|
Loading…
Reference in New Issue