Skip to content

Commit 80eb313

Browse files
authored
[COMCTL32] Pager: Fix PGM_RECALCSIZE behaviour (reactos#7875)
JIRA issue: CORE-7017 - Add m_bProcessingReCalcSize to PAGER_INFO structure. - Fix EM_FMTLINES and PGM_RECALCSIZE handling, by usiing m_bProcessingReCalcSize.
1 parent 00983aa commit 80eb313

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

dll/win32/comctl32/pager.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ typedef struct
8686
INT direction; /* direction of the scroll, (e.g. PGF_SCROLLUP) */
8787
WCHAR *pwszBuffer;/* text buffer for converted notifications */
8888
INT nBufferSize;/* size of the above buffer */
89+
#ifdef __REACTOS__
90+
BOOL m_bProcessingReCalcSize;
91+
#endif
8992
} PAGER_INFO;
9093

9194
#define TIMERID1 1
@@ -423,6 +426,15 @@ PAGER_RecalcSize(PAGER_INFO *infoPtr)
423426
{
424427
TRACE("[%p]\n", infoPtr->hwndSelf);
425428

429+
#ifdef __REACTOS__
430+
if (!infoPtr->m_bProcessingReCalcSize)
431+
{
432+
infoPtr->m_bProcessingReCalcSize = TRUE;
433+
/* NOTE: Posting a recalc message to ourselves, not actually an edit control message */
434+
PostMessageW(infoPtr->hwndSelf, EM_FMTLINES, 0, 0);
435+
}
436+
return 0;
437+
#else
426438
if (infoPtr->hwndChild)
427439
{
428440
INT scrollRange = PAGER_GetScrollRange(infoPtr, TRUE);
@@ -437,6 +449,7 @@ PAGER_RecalcSize(PAGER_INFO *infoPtr)
437449
}
438450

439451
return 1;
452+
#endif
440453
}
441454

442455

@@ -555,8 +568,15 @@ PAGER_Scroll(PAGER_INFO* infoPtr, INT dir)
555568
}
556569

557570
static LRESULT
571+
#ifdef __REACTOS__
572+
PAGER_FmtLines(PAGER_INFO *infoPtr)
573+
#else
558574
PAGER_FmtLines(const PAGER_INFO *infoPtr)
575+
#endif
559576
{
577+
#ifdef __REACTOS__
578+
infoPtr->m_bProcessingReCalcSize = FALSE;
579+
#endif
560580
/* initiate NCCalcSize to resize client wnd and get size */
561581
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
562582
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE |

0 commit comments

Comments
 (0)