diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-03 22:50:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-03 22:50:22 +0300 |
commit | 1974e62136d2bed460fe1ead68ff84aed5daee95 (patch) | |
tree | cc80d606cb3ccede0f902cde10fbd8c47d55d5d6 | |
parent | 4176b0d170dca89d2a4ecaa403b9b6fd0770a821 (diff) |
no need to post WM_SIZE so often
-rw-r--r-- | include/m_gui.h | 2 | ||||
-rw-r--r-- | src/mir_core/src/ui_utils.cpp | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/include/m_gui.h b/include/m_gui.h index dfeabe7dd0..698ee81ba6 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -602,7 +602,7 @@ protected: virtual LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
virtual void OnInit() override;
- int m_iPosition;
+ int m_iPosition, m_iCount;
};
/////////////////////////////////////////////////////////////////////////////////////////
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;
}
|