diff --git a/DSView/pv/mainframe.cpp b/DSView/pv/mainframe.cpp index c972e7c6..f9e91588 100644 --- a/DSView/pv/mainframe.cpp +++ b/DSView/pv/mainframe.cpp @@ -759,16 +759,7 @@ void MainFrame::AttachNativeWindow() _titleBar->EnableAbleDrag(false); setWindowFlags(Qt::FramelessWindowHint); - - if (nativeWindow->IsWin7()){ - SetWindowLong((HWND)winId(), GWL_STYLE, WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - } - else{ - SetWindowLong((HWND)winId(), GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - } - - SetWindowLong((HWND)winId(), GWL_STYLE, WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - + SetWindowLong((HWND)winId(), GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); SetParent((HWND)winId(), nativeWindow->Handle()); setVisible(true); diff --git a/DSView/pv/winnativewidget.cpp b/DSView/pv/winnativewidget.cpp index 160bc597..3a551267 100644 --- a/DSView/pv/winnativewidget.cpp +++ b/DSView/pv/winnativewidget.cpp @@ -65,11 +65,13 @@ WinNativeWidget::WinNativeWidget(const int x, const int y, const int width, _hWnd = NULL; _event_callback = NULL; _is_lose_foreground = false; - - _titleBarWidget = NULL; - _is_native_border = IsWin11OrGreater(); _hCurrentMonitor = NULL; _shadow = NULL; + _titleBarWidget = NULL; + + _is_native_border = IsWin11OrGreater(); + _is_win7 = IsWin7(); + _border_color = QColor(0x80,0x80,0x80); int r = backColor.red(); int g = backColor.green(); @@ -77,7 +79,6 @@ WinNativeWidget::WinNativeWidget(const int x, const int y, const int width, HINSTANCE hInstance = GetModuleHandle(nullptr); WNDCLASSEX wcx; - memset(&wcx, 0, sizeof(WNDCLASSEXW)); wcx.cbSize = sizeof(WNDCLASSEX); @@ -365,6 +366,13 @@ LRESULT CALLBACK WinNativeWidget::WndProc(HWND hWnd, UINT message, WPARAM wParam } break; } + case WM_MOUSEWHEEL: + { + if (self->_is_win7 && self->_childWindow != NULL){ + return SendMessage(self->_childWindow, message, wParam, lParam); + } + break; + } } return DefWindowProc(hWnd, message, wParam, lParam); diff --git a/DSView/pv/winnativewidget.h b/DSView/pv/winnativewidget.h index 99e8d67a..dcc63224 100644 --- a/DSView/pv/winnativewidget.h +++ b/DSView/pv/winnativewidget.h @@ -85,8 +85,8 @@ public: bool isActiveWindow(); void SetBorderColor(QColor color); - bool IsWin11OrGreater(); - bool IsWin7(); + static bool IsWin11OrGreater(); + static bool IsWin7(); inline void SetTitleBarWidget(QWidget *w){ _titleBarWidget = w; @@ -126,6 +126,7 @@ private: WinShadow *_shadow; QColor _border_color; bool _is_lose_foreground; + bool _is_win7; }; }