summaryrefslogtreecommitdiff
path: root/src/Fl_Native_File_Chooser_WIN32.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-04-22 14:40:01 +0000
committerManolo Gouy <Manolo>2015-04-22 14:40:01 +0000
commit335927ab905d38afa4206a394641ec29c8d4b473 (patch)
tree7249a79ae907f72d566f987768b6eb792bb42ed6 /src/Fl_Native_File_Chooser_WIN32.cxx
parent333b5268c3d8a956e3dd8e8085a090b333417853 (diff)
Fix for STR #3221: restore the correct state of mouse buttons and keyboard modifier keys
after closing a non-FLTK window (file or printer dialogs). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10713 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Native_File_Chooser_WIN32.cxx')
-rw-r--r--src/Fl_Native_File_Chooser_WIN32.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Fl_Native_File_Chooser_WIN32.cxx b/src/Fl_Native_File_Chooser_WIN32.cxx
index fbadd21a0..2f36635bc 100644
--- a/src/Fl_Native_File_Chooser_WIN32.cxx
+++ b/src/Fl_Native_File_Chooser_WIN32.cxx
@@ -568,13 +568,21 @@ int Fl_Native_File_Chooser::showdir() {
// -1 - failed; errmsg() has reason
//
int Fl_Native_File_Chooser::show() {
+ int retval;
if ( _btype == BROWSE_DIRECTORY ||
_btype == BROWSE_MULTI_DIRECTORY ||
_btype == BROWSE_SAVE_DIRECTORY ) {
- return(showdir());
+ retval = showdir();
} else {
- return(showfile());
+ retval = showfile();
}
+ // restore the correct state of mouse buttons and keyboard modifier keys (STR #3221)
+ HWND h = GetForegroundWindow();
+ if (h) {
+ WNDPROC windproc = (WNDPROC)GetWindowLongPtrW(h, GWLP_WNDPROC);
+ CallWindowProc(windproc, h, WM_ACTIVATEAPP, 1, 0);
+ }
+ return retval;
}
// RETURN ERROR MESSAGE