summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-05-19 16:22:29 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-05-19 16:22:29 +0000
commit461d60a0f3543e07e19e8a5739097566e0851793 (patch)
treed2453efc7df47bf8a94a0d05a8923119a34d2ba0
parent067d8d2d16d14d7d1ff024653ac383a2662a4806 (diff)
Revert WIN32 redraw fix from r4244, and apply a new one that is a bit
cleaner which should not cause problems. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4360 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES1
-rw-r--r--src/Fl_win32.cxx30
2 files changed, 16 insertions, 15 deletions
diff --git a/CHANGES b/CHANGES
index af9b4182a..465f2d1bf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745)
+ - Fixed some redraw issues on Windows XP.
- FLUID didn't set the initial size of widgets properly
(STR #850)
- Fl_Tabs would steal focus away from its children on a
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 0e5aeaf85..12d17c478 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -589,27 +589,27 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
case WM_PAINT: {
- Fl_Region R, sysR = CreateRectRgn(0,0,0,0);
- GetUpdateRgn(hWnd,sysR,0);
+ Fl_Region R;
Fl_X *i = Fl_X::i(window);
i->wait_for_expose = 0;
if (!i->region && window->damage()) {
// Redraw the whole window...
i->region = CreateRectRgn(0, 0, window->w(), window->h());
+ }
+
+ // We need to merge WIN32's damage into FLTK's damage.
+ R = CreateRectRgn(0,0,0,0);
+ GetUpdateRgn(hWnd,R,0);
+
+ 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 {
- // We need to merge WIN32's damage into FLTK's damage.
- R = CreateRectRgn(0,0,0,0);
- GetUpdateRgn(hWnd,R,0);
-
- 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;
- }
+ i->region = R;
}
+
window->clear_damage((uchar)(window->damage()|FL_DAMAGE_EXPOSE));
// These next two statements should not be here, so that all update
// is deferred until Fl::flush() is called during idle. However WIN32
@@ -620,7 +620,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,sysR);
+ else ValidateRgn(hWnd,i->region);
window->clear_damage();
} return 0;