VM Question: Full Screen Mode Startup
Noel J. Bergman
noel at devtech.com
Mon Jan 21 20:43:21 UTC 2002
Les,
Which VM are you using? I am using Squeak-D3D.exe from May.
Actually, you've reminding me that I made a change in the PocketPC code that
may not have been carried over into Andreas' code base yet. Take at look at
sqWin32Window.c (Win32) and sqWin32Window.cpp (WinCE). As I recall, the
code for WM_PAINT handling in sqWin32Windows.c is/was wrong. It read:
case WM_PAINT:
/* retrieve update region _before_ calling BeginPaint() !!! */
GetUpdateRgn(hwnd,updateRgn,FALSE);
BeginPaint(hwnd,&ps);
/* store the rectangle required for image bit reversal */
updateRect = ps.rcPaint;
EndPaint(hwnd,&ps);
/* Avoid repaint unless absolutely necessary (null update rects are
quite common) */
if (!IsRectEmpty(&updateRect)) {
/* force redraw the next time ioShowDisplay() is called */
updateRightNow = TRUE;
fullDisplayUpdate(); /* this makes VM call ioShowDisplay */
}
That is also what used to be in the PocketPC version of the file, too, until
I fixed it:
case WM_PAINT:
/* retrieve update region _before_ calling BeginPaint() !!! */
#ifdef USE_GAPI
if (GetForegroundWindow() == hwnd) {
// should probably be in ioShowDisplay()
#endif
if (GetUpdateRect(hwnd, NULL, FALSE)) {
/* An application should call the GetUpdateRect function to
determine
* whether the window has an update region. If GetUpdateRect returns
* zero, the application should not call the BeginPaint and EndPaint
functions. */
GetUpdateRgn(hwnd,updateRgn,FALSE);
BeginPaint(hwnd,&ps);
/* store the rectangle required for image bit reversal */
updateRect = ps.rcPaint;
EndPaint(hwnd,&ps);
/* Avoid repaint unless absolutely necessary (null update rects are
quite common) */
// if (!IsRectEmpty(&updateRect)) {
/* force redraw the next time ioShowDisplay() is called */
updateRightNow = TRUE;
fullDisplayUpdate(); /* this makes VM call ioShowDisplay */
// }
}
#ifdef USE_GAPI
}
#endif
break;
Since USE_GAPI won't be defined on Win32, you should be able to replace the
entire code segment. Hopefully, if/when someone gets around to fully
merging Ohshima-san's PocketPC files with Andreas' Windows code, these fixes
will be preserved into the common code. As I recall, that change fixed a
flicker problem I'd seen with the PocketPC.
Let me know if that change helps.
--- Noel
More information about the Squeak-dev
mailing list
|