This is an attempt to fix the redraw problem on WinXP and other Windows variants.

This is how the bug looks like: load a test project that uses a single buffer window, 'scroll' fails nicely. Compile (in debug mode) and run. If you now quickly drag another window across the fltk window, some white spots will remain unrefreshed. Another great candidate is 'input_choice', but 'fluid's toolbox fails as well.

This fix is part of the WM_PAINT message handler. Instead of validating the whole area that FLTK drew, we now only validate the area that Win32 beleives was damaged. This may be inefficient if we redraw larger areas, but I did not see any refresh errors anymore, which IMHO has priority.

Again, I'd be very happy if other ussers could check for and confirm the bug and the fix.

Thanks!



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4244 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2005-04-07 13:39:43 +00:00
parent ae865138a6
commit 500665b24d

View File

@ -587,7 +587,8 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
case WM_PAINT: {
Fl_Region R;
Fl_Region R, sysR = CreateRectRgn(0,0,0,0);
GetUpdateRgn(hWnd,sysR,0);
Fl_X *i = Fl_X::i(window);
i->wait_for_expose = 0;
if (!i->region && window->damage()) {
@ -617,7 +618,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
i->flush();
fl_restore_pen();
if (window->type() == FL_DOUBLE_WINDOW) ValidateRgn(hWnd,0);
else ValidateRgn(hWnd,i->region);
else ValidateRgn(hWnd,sysR);
window->clear_damage();
} return 0;