Free application with menu redrawing/flicker loop (window position mismatch?)
Dmitry Timoshkov
dmitry at baikal.ru
Wed Jun 30 01:40:54 CDT 2004
"Andreas Mohr" <andi at rhlx01.fht-esslingen.de> wrote:
> The following program which a school employee (4000 pupils!) asked me about
> that prevents his school administration from switching to Linux has problems
> with continuous redrawing of the menu bar and non-redrawing of the client area
> (resulting from continuous menu redrawing?):
> http://schulverwaltungsprogramme.mswwf.nrw.de/mswf_software/html/winplan.html
>
> Note that installation runs fine; it's the main program which breaks.
>
> The relay log shows signs of a WM_WINDOWPOSCHANGING/WM_WINDOWPOSCHANGED loop
> or something like that.
> If someone more familiar with messaging and window management could have a
> look at it, then I'm sure he'd greatly appreciate it. :)
This is because the app does SetWindowText() on its MDI frame window
on each WM_WINDOWPOSCHANGED message and our MDI_UpdateFrameText
implementation did SetWindowPos(SWP_FRAMECHANGED) every time,
therefore we have an infinite loop.
I don't see at all why that SetWindowPos is needed, DefWindowProc
already takes care of it.
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Do not do SetWindowPos(SWP_FRAMECHANGED) in the DefFrameProc(WM_SETTEXT)
handler, DefWindowProc already takes care of it.
--
Dmitry.
-------------- next part --------------
--- cvs/hq/wine/windows/mdi.c Fri Jun 25 22:02:44 2004
+++ wine/windows/mdi.c Wed Jun 30 15:28:07 2004
@@ -132,7 +132,7 @@ typedef struct
static HBITMAP hBmpClose = 0;
/* ----------------- declarations ----------------- */
-static void MDI_UpdateFrameText( HWND, HWND, BOOL, LPCWSTR);
+static void MDI_UpdateFrameText( HWND, HWND, LPCWSTR);
static BOOL MDI_AugmentFrameMenu( HWND, HWND );
static BOOL MDI_RestoreFrameMenu( HWND, HWND );
static LONG MDI_ChildActivate( HWND, HWND );
@@ -592,7 +592,7 @@ static LONG MDI_ChildActivate( HWND clie
MDI_RestoreFrameMenu(frame, child);
}
- MDI_UpdateFrameText(frame, client, TRUE, NULL);
+ MDI_UpdateFrameText(frame, client, NULL);
/* check if we have any children left */
if( !child )
@@ -929,13 +929,12 @@ static BOOL MDI_RestoreFrameMenu( HWND f
*
* Note: lpTitle can be NULL
*/
-static void MDI_UpdateFrameText( HWND frame, HWND hClient,
- BOOL repaint, LPCWSTR lpTitle )
+static void MDI_UpdateFrameText( HWND frame, HWND hClient, LPCWSTR lpTitle )
{
WCHAR lpBuffer[MDI_MAXTITLELENGTH+1];
MDICLIENTINFO *ci = get_client_info( hClient );
- TRACE("repaint %i, frameText %s\n", repaint, debugstr_w(lpTitle));
+ TRACE("frameText %s\n", debugstr_w(lpTitle));
if (!ci) return;
@@ -984,9 +983,6 @@ static void MDI_UpdateFrameText( HWND fr
lpBuffer[0] = '\0';
DefWindowProcW( frame, WM_SETTEXT, 0, (LPARAM)lpBuffer );
- if( repaint )
- SetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED |
- SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER );
}
@@ -1255,7 +1251,7 @@ LRESULT WINAPI DefFrameProcA( HWND hwnd,
DWORD len = MultiByteToWideChar( CP_ACP, 0, (LPSTR)lParam, -1, NULL, 0 );
LPWSTR text = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, (LPSTR)lParam, -1, text, len );
- MDI_UpdateFrameText(hwnd, hwndMDIClient, TRUE, text );
+ MDI_UpdateFrameText( hwnd, hwndMDIClient, text );
HeapFree( GetProcessHeap(), 0, text );
}
return 1; /* success. FIXME: check text length */
@@ -1329,7 +1325,7 @@ LRESULT WINAPI DefFrameProcW( HWND hwnd,
break;
case WM_SETTEXT:
- MDI_UpdateFrameText(hwnd, hwndMDIClient, TRUE, (LPWSTR)lParam );
+ MDI_UpdateFrameText( hwnd, hwndMDIClient, (LPWSTR)lParam );
return 1; /* success. FIXME: check text length */
case WM_SETFOCUS:
@@ -1387,7 +1383,7 @@ LRESULT WINAPI DefMDIChildProcA( HWND hw
case WM_SETTEXT:
DefWindowProcA(hwnd, message, wParam, lParam);
if( ci->hwndActiveChild == hwnd && IsZoomed(ci->hwndActiveChild) )
- MDI_UpdateFrameText( GetParent(client), client, TRUE, NULL );
+ MDI_UpdateFrameText( GetParent(client), client, NULL );
return 1; /* success. FIXME: check text length */
case WM_GETMINMAXINFO:
@@ -1426,7 +1422,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hw
case WM_SETTEXT:
DefWindowProcW(hwnd, message, wParam, lParam);
if( ci->hwndActiveChild == hwnd && IsZoomed(ci->hwndActiveChild) )
- MDI_UpdateFrameText( GetParent(client), client, TRUE, NULL );
+ MDI_UpdateFrameText( GetParent(client), client, NULL );
return 1; /* success. FIXME: check text length */
case WM_GETMINMAXINFO:
@@ -1480,7 +1476,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hw
if( hwnd == ci->hwndActiveChild && wParam != SIZE_MAXIMIZED )
{
MDI_RestoreFrameMenu( GetParent(client), hwnd );
- MDI_UpdateFrameText( GetParent(client), client, TRUE, NULL );
+ MDI_UpdateFrameText( GetParent(client), client, NULL );
}
if( wParam == SIZE_MAXIMIZED )
@@ -1488,7 +1484,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hw
TRACE("maximizing child %p\n", hwnd );
MDI_AugmentFrameMenu( GetParent(client), hwnd );
- MDI_UpdateFrameText( GetParent(client), client, TRUE, NULL );
+ MDI_UpdateFrameText( GetParent(client), client, NULL );
}
if( wParam == SIZE_MINIMIZED )
More information about the wine-patches
mailing list