diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2005-07-25 09:51:20 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2005-07-25 09:51:20 +0000 |
| commit | b6f2bc925021c83f0b6f73614b6c29ae32779723 (patch) | |
| tree | daed3bfe4b56e9874909325a7f8b445892964244 /src | |
| parent | b1ad1a2f96b8296f51980972331610dac87edae6 (diff) | |
STR #831: When moving an OpenGL window outside the screen and then back again lets fltk get stuck.
The problem seems to be an idefinite repeat of the WM_PAINT message. The driver sends an internale WM_PAINT (one that does not contain an update region). FLTK then creates a union with the still existin 'i->region' of the OpenGL window, causing yet another WM_PAINT message.
The fix is to not run through the WM_PAINT handler at all if there is no update region (as suggested by Microsoft). This change is definetly debatable, since it does modify some internal FLTK behavior. I will commit it anyways for now, but we should pay very close attention to redraw problems by those who use the svn releases.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4456 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_win32.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 723f76297..c135d3256 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -601,14 +601,19 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar Fl_Region R; Fl_X *i = Fl_X::i(window); i->wait_for_expose = 0; + char redraw_whole_window = false; if (!i->region && window->damage()) { // Redraw the whole window... i->region = CreateRectRgn(0, 0, window->w(), window->h()); + redraw_whole_window = true; } // We need to merge WIN32's damage into FLTK's damage. R = CreateRectRgn(0,0,0,0); - GetUpdateRgn(hWnd,R,0); + int r = GetUpdateRgn(hWnd,R,0); + if (r==NULLREGION && !redraw_whole_window) { + break; + } if (i->region) { // Also tell WIN32 that we are drawing someplace else as well... |
