summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2007-05-16 12:47:49 +0000
committerMatthias Melcher <fltk@matthiasm.com>2007-05-16 12:47:49 +0000
commit04ced5396e67c19ea808b64c851f8fa039e8eb95 (patch)
tree3465783b4a888ca4d08401c6948a5488e0927b40 /src
parent849efb47ae1ba1d3169044a6a949b4c73b770f55 (diff)
STR #1681: On WIN32 WM_PAINT messages, FLTK would first render the damaged area and then set the area as valid again. While this is mostly fine on single CPU machines, multi-CPU machines may re-invalidate areas that are currently drawn, resulting in unrendered strips when another window was moved quickly across an FLTK window during its redraw phase.
The new implementation validates the damaged area as quickly as possible, allowing new damage requests to be handled correctly, even while we are still redrawing the same damaged area. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5836 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_win32.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 94686a195..607b8b750 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -723,12 +723,13 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
if (i->region) {
// Also tell WIN32 that we are drawing someplace else as well...
- InvalidateRgn(hWnd, i->region, FALSE);
CombineRgn(i->region, i->region, R, RGN_OR);
XDestroyRegion(R);
} else {
i->region = R;
}
+ if (window->type() == FL_DOUBLE_WINDOW) ValidateRgn(hWnd,0);
+ else ValidateRgn(hWnd,i->region);
window->clear_damage((uchar)(window->damage()|FL_DAMAGE_EXPOSE));
// These next two statements should not be here, so that all update
@@ -739,8 +740,6 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
fl_save_pen();
i->flush();
fl_restore_pen();
- if (window->type() == FL_DOUBLE_WINDOW) ValidateRgn(hWnd,0);
- else ValidateRgn(hWnd,i->region);
window->clear_damage();
} return 0;