diff options
| author | Manolo Gouy <Manolo> | 2015-04-22 14:40:01 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2015-04-22 14:40:01 +0000 |
| commit | 335927ab905d38afa4206a394641ec29c8d4b473 (patch) | |
| tree | 7249a79ae907f72d566f987768b6eb792bb42ed6 /src/Fl_GDI_Printer.cxx | |
| parent | 333b5268c3d8a956e3dd8e8085a090b333417853 (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_GDI_Printer.cxx')
| -rw-r--r-- | src/Fl_GDI_Printer.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Fl_GDI_Printer.cxx b/src/Fl_GDI_Printer.cxx index 60366424f..98a3a7be4 100644 --- a/src/Fl_GDI_Printer.cxx +++ b/src/Fl_GDI_Printer.cxx @@ -68,7 +68,12 @@ int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage) pd.Flags = PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE | PD_NOSELECTION; pd.nMinPage = 1; pd.nMaxPage = pagecount; - if (PrintDlg (&pd) != 0) { + BOOL b = PrintDlg (&pd); + if (pd.hwndOwner) { // restore the correct state of mouse buttons and keyboard modifier keys (STR #3221) + WNDPROC windproc = (WNDPROC)GetWindowLongPtrW(pd.hwndOwner, GWLP_WNDPROC); + CallWindowProc(windproc, pd.hwndOwner, WM_ACTIVATEAPP, 1, 0); + } + if (b != 0) { hPr = pd.hDC; if (hPr != NULL) { strcpy (docName, "FLTK"); @@ -77,14 +82,14 @@ int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage) di.lpszDocName = (LPCSTR) docName; prerr = StartDoc (hPr, &di); if (prerr < 1) { - abortPrint = TRUE; - //fl_alert ("StartDoc error %d", prerr); - err = 1; + abortPrint = TRUE; + //fl_alert ("StartDoc error %d", prerr); + err = 1; } } else { commdlgerr = CommDlgExtendedError (); fl_alert ("Unable to create print context, error %lu", - (unsigned long) commdlgerr); + (unsigned long) commdlgerr); err = 1; } } else { |
