JDK-6379599 : REG: Showing and disposing a native page dialog makes the main frame inactive, Win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-02-01
  • Updated: 2011-01-19
  • Resolved: 2006-02-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b73Fixed
Related Reports
Relates :  
Relates :  
Description
I have a frame with few buttons on it. On clicking one of the buttons, I am bringing up the native page dialog. Once the dialog is shown, I am pressing 'ESC' and the dialog is disposed. After that, the frame becomes inactive and focus does not come back to the same component automatically. I would expect the frame to be active and focus should remain with the same component which brought up the dialog.

This is a regression in Mustang introduced in b53. This is reproducible only on Win32 and not on XToolkit. It works fine on Tiger-FCS and Mustang-b51. 

Run the attached application. Press the button. A native page dialog will come up. Press 'ESC'. Check the main frame. If it is not active, the bug is reproduced.

Comments
EVALUATION This regression of the fix for 6302514. Before the fix for 6302514 parent was activated after the native dialogs hidden. By now these dialogs are parentless, and it turned out that there's no active window at all. Fix for 6365992 repairs it for the native print dialogs. This CR was created to fix the same thing for the page dialogs. It works fine for the native file dialogs and non-native dialogs.
08-02-2006

EVALUATION Look at the CR# 6365992 for more information. We have to fix the problem about the native page dialogs as well.
03-02-2006

SUGGESTED FIX -bash-2.05b$ sccs diffs -C awt_PrintJob.cpp ------- awt_PrintJob.cpp ------- *** /tmp/sccs.tkJM3b 2006-02-03 13:08:05.000000000 +0300 --- awt_PrintJob.cpp 2006-02-03 13:04:41.000000000 +0300 *************** *** 387,392 **** --- 387,393 ---- DASSERT(self != NULL); AwtComponent *awtParent = (parent != NULL) ? (AwtComponent *)JNI_GET_PDATA(parent) : NULL; + HWND hwndOwner = awtParent ? awtParent->GetHWnd() : NULL; jboolean doIt = JNI_FALSE; // Assume the user will cancel the dialog. PAGESETUPDLG setup; *************** *** 500,508 **** AwtDialog::CheckUninstallModalHook(); ! if (awtParent != NULL) { ! AwtDialog::ModalNextWindowToFront(awtParent->GetHWnd()); ! } HGLOBAL oldG = AwtPrintControl::getPrintHDMode(env, self); if (setup.hDevMode != oldG) { --- 501,507 ---- AwtDialog::CheckUninstallModalHook(); ! AwtDialog::ModalNextWindowToFront(hwndOwner); HGLOBAL oldG = AwtPrintControl::getPrintHDMode(env, self); if (setup.hDevMode != oldG) {
03-02-2006

EVALUATION Seems caused by the same reason as 6365992.
01-02-2006