summaryrefslogtreecommitdiff
path: root/src/Fl_win32.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-06-11 14:09:28 +0000
committerPierre Ossman <ossman@cendio.se>2014-06-11 14:09:28 +0000
commit7057e56c28f7c08d45521fbc29efaf5a4913bf1a (patch)
tree534f95f790f770189f13d4b7bc296926cfdd8e0b /src/Fl_win32.cxx
parent0cfc2554c695bd472ce9e579ddcf1240f4fa155a (diff)
Behave better when it comes to modal windows. Primarily this
makes sure that windows are decorated better when a modal window is active. STR #2802. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10190 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_win32.cxx')
-rw-r--r--src/Fl_win32.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index fceae16f1..8ca3a70ec 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1099,6 +1099,10 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
case WM_SETFOCUS:
+ if ((Fl::modal_) && (Fl::modal_ != window)) {
+ SetFocus(fl_xid(Fl::modal_));
+ return 0;
+ }
Fl::handle(FL_FOCUS, window);
break;
@@ -1845,6 +1849,11 @@ Fl_X* Fl_X::make(Fl_Window* w) {
Fl::e_number = old_event;
w->redraw(); // force draw to happen
}
+
+ // Needs to be done before ShowWindow() to get the correct behaviour
+ // when we get WM_SETFOCUS.
+ if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
+
// If we've captured the mouse, we dont want to activate any
// other windows from the code, or we lose the capture.
ShowWindow(x->xid, !showit ? SW_SHOWMINNOACTIVE :
@@ -1862,7 +1871,6 @@ Fl_X* Fl_X::make(Fl_Window* w) {
}
}
- if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
return x;
}