From 1974e62136d2bed460fe1ead68ff84aed5daee95 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Mar 2017 22:50:22 +0300 Subject: no need to post WM_SIZE so often --- src/mir_core/src/ui_utils.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index c5f69082d8..20b2a34140 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -2575,7 +2575,8 @@ void CCtrlPages::OnDestroy() CSplitter::CSplitter(CDlgBase *wnd, int idCtrl) : CCtrlBase(wnd, idCtrl), - m_iPosition(0) + m_iPosition(0), + m_iCount(0) { } @@ -2587,13 +2588,12 @@ void CSplitter::OnInit() LRESULT CSplitter::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) { - RECT rc; - switch (msg) { case WM_NCHITTEST: return HTCLIENT; case WM_SETCURSOR: + RECT rc; GetClientRect(m_hwnd, &rc); SetCursor(rc.right > rc.bottom ? g_hCursorNS : g_hCursorWE); return TRUE; @@ -2618,11 +2618,18 @@ LRESULT CSplitter::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) } OnChange(this); + + if (m_iCount == 3) { + m_iCount = 0; + PostMessage(m_parentWnd->GetHwnd(), WM_SIZE, 0, 0); + } + else m_iCount++; } return 0; case WM_LBUTTONUP: ReleaseCapture(); + PostMessage(m_parentWnd->GetHwnd(), WM_SIZE, 0, 0); return 0; } -- cgit v1.2.3