richedit: Prevented an assertion error on startup when run on Windows.
The call to GetClientRect returns 0 values for the returned RECT when called in WM_NCCREATE in on Windows, which ended up causing an assertion error when Wine's riched20.dll replaces the native version. Moving the call to WM_CREATE fixes this problem (probably because NCCALCSIZE is called in between).
This commit is contained in:
parent
1840a5bcad
commit
67024f0f34
|
@ -1666,7 +1666,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
|
||||||
ed->mode = TM_RICHTEXT | TM_MULTILEVELUNDO | TM_MULTICODEPAGE;
|
ed->mode = TM_RICHTEXT | TM_MULTILEVELUNDO | TM_MULTICODEPAGE;
|
||||||
ed->AutoURLDetect_bEnable = FALSE;
|
ed->AutoURLDetect_bEnable = FALSE;
|
||||||
ed->bHaveFocus = FALSE;
|
ed->bHaveFocus = FALSE;
|
||||||
GetClientRect(hWnd, &ed->rcFormat);
|
|
||||||
for (i=0; i<HFONT_CACHE_SIZE; i++)
|
for (i=0; i<HFONT_CACHE_SIZE; i++)
|
||||||
{
|
{
|
||||||
ed->pFontCache[i].nRefs = 0;
|
ed->pFontCache[i].nRefs = 0;
|
||||||
|
@ -2934,6 +2933,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
|
||||||
return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y );
|
return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y );
|
||||||
}
|
}
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
|
GetClientRect(hWnd, &editor->rcFormat);
|
||||||
if (GetWindowLongW(hWnd, GWL_STYLE) & WS_HSCROLL)
|
if (GetWindowLongW(hWnd, GWL_STYLE) & WS_HSCROLL)
|
||||||
{ /* Squelch the default horizontal scrollbar it would make */
|
{ /* Squelch the default horizontal scrollbar it would make */
|
||||||
ShowScrollBar(editor->hWnd, SB_HORZ, FALSE);
|
ShowScrollBar(editor->hWnd, SB_HORZ, FALSE);
|
||||||
|
|
Loading…
Reference in New Issue