JDK-4645584 : Invoking modal dialog while performing DnD freezes application.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2002-03-01
  • Updated: 2002-05-20
  • Resolved: 2002-04-25
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.
Other
1.4.1 hopperFixed
Related Reports
Relates :  
Relates :  
Description
I experience it reproducbly on NetBeans while tring to implement DnD.
I believe it would be the same on other apps.

Scenario:
1) Start drag operation.
2) Let invoke modal dialog to be shown (programatically) while still
doing the drag.
3) The dialog is poped up. The cursor is changed to normal one, but no drapDropFinished on DragSourceContextPeer was made, consequentelly no dragDropEnd on DragSourceListener. Thus the DnD sys prevents any key/mouse event
to be propagated to the dialog, while also the DnD istelf is not able to finish.
4) The app freezes.

Additional comments.
I also tried programatically to close the dialog in that case, and the app seemed to be working, even still the DragSourceDropEvent wasn't propagated.
But that not the acceptable workaround.
I don't see the needed one, at least there is needed ability to programatically cancell of processed DnD, but seems it is internal thing of the DragSourceContextPeer.
===============================


Here is the testcase, (tescase.zip ), extract to default dir compile and execute the Test. It is your example of DnD published on jdc with added button on the bottom which invokes the modal dialog from separate thread in 3 sec. Whithin the time you start do the drag and wait. Dialog appears and you can nothing to do neither from keyboard nor by mouse.
I came closer to the problem, in the testcase the dialog has default close operation DO_NOTHING_ON_CLOSE, which prevents the dialog to be closed by "x" button. But thats the problem of DnD it doesn't let pass other event to the dialog only to the "x" button, thus when the dialog is supposed to be closed on
"Close" button it is not propagated there.
I hope this will help enough.

I also want to point out why there was required testcase. Didn't I describe the problem clearly enough. I guess there shouldn't be a problem for to create a testcase according the description?

###@###.### 2002-03-04
==================================

The above commnent with the DO_NOTHING_ON_CLOSE is not valid, it just helps
in seldom cases. Thus the bug is much more serious.
###@###.### 2002-03-21
=================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: hopper FIXED IN: hopper INTEGRATED IN: hopper VERIFIED IN: hopper
14-06-2004

EVALUATION Since the submitter mentions DnD, I'll reassign to the DnD subcategory. Since there is no test case, I'll mark the bug report as incomplete. ###@###.### 2002-03-01 This bug manifests on X11 systems with JDK1.4.1-b03. > This hang is the same as the one documented under bug id 4352221. > A similar hang is documented under bug id 4484572. > On Win32 the app hangs only if the modal dialog is shown on the event > dispatch thread while it executes one of DropTargetListener methods. > The details of this hang are provided in the evaluation for 4623377. > On X11 systems the app hangs whenever the modal dialog is shown while > the drag operation is in progress. The reason is that on X11 both > modal dialog and Motif drag-and-drop involve pointer grab. The > conflict between these two grabs causes X server freeze. ###@###.### 2002-03-05 Name: dsR10078 Date: 04/04/2002 The attached test case (tescase.zip) reproduces the hang documented under bug id 4484572. I verified that with the suggested fix for 4484572 this bug is no longer reproducible. When a modal dialog is displayed, the drag operation is forcibly cancelled and dragDropEnd is called. ###@###.### 2002-04-04 ======================================================================
04-04-2002