From 38ee5f1e23a0ef589a2d4e072c6e30282a698e64 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Fri, 23 Feb 2024 17:39:04 +0800 Subject: [PATCH] fix: the ComboBox can't popu to a right postion after moved on windows --- DSView/pv/winnativewidget.cpp | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/DSView/pv/winnativewidget.cpp b/DSView/pv/winnativewidget.cpp index 1b1db41f..4b49b70e 100644 --- a/DSView/pv/winnativewidget.cpp +++ b/DSView/pv/winnativewidget.cpp @@ -169,26 +169,26 @@ LRESULT CALLBACK WinNativeWidget::WndProc(HWND hWnd, UINT message, WPARAM wParam void WinNativeWidget::ResizeChild() { - if (_childWindow != NULL){ - - RECT rc; - GetClientRect(_hWnd, &rc); - - int w = rc.right; - int h = rc.bottom; + if (_childWindow != NULL){ + RECT rc; + GetClientRect(_hWnd, &rc); - WINDOWPLACEMENT wp; - wp.length = sizeof(WINDOWPLACEMENT); - GetWindowPlacement(_hWnd, &wp); + int w = rc.right; + int h = rc.bottom; - if (wp.showCmd == SW_MAXIMIZE) { - w -= 8; - h -= 8; - } - - childWidget->adjustSize(); - MoveWindow(_childWindow, 0, 0, w , h , 1); - + WINDOWPLACEMENT wp; + wp.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(_hWnd, &wp); + + if (wp.showCmd == SW_MAXIMIZE) { + w -= 8; + h -= 8; + } + + //childWidget->adjustSize(); + MoveWindow(_childWindow, 0, 0, w - 1 , h - 1 , 1); + MoveWindow(_childWindow, 0, 0, w , h , 1); + childWidget->updateGeometry(); } }