JDK-4426750 : REGRESSION: middle mouse click doesn't paste primary selection
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: generic
  • Submitted: 2001-03-16
  • Updated: 2002-01-11
  • Resolved: 2001-03-20
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 Availabitlity Release.

To download the current JDK release, click here.
1.4.0 betaFixed
Related Reports
Relates :  

Name: dsR10078			Date: 03/16/2001

Motif widgets used by TextField and TextArea support pasting the
of primary selection on the middle mouse button click.
The fix for 4407057 disables this functionality, which is a serious

###@###.### 2001-03-16

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta VERIFIED IN: merlin-rc1

WORK AROUND Name: dsR10078 Date: 03/16/2001 ======================================================================

EVALUATION Commit to merlin-beta (regression). ###@###.### 2001-03-16 Name: dsR10078 Date: 03/17/2001 In XmText and XmTextField widgets default Motif translations for Btn2Down event change the widget state, so that on the Btn2Up it will be able to paste the primary selection contents. The fix for 4407057 disables these translations, so primary selection is not pasted. ###@###.### 2001-03-17 ======================================================================

SUGGESTED FIX Name: dsR10078 Date: 03/17/2001 Backout the fix for 4407057 and apply a new fix which is more compact, provides more complete solution for disabling Motif default drag support and doesn't have such side effects. The previous version of the fix didn't address several cases: Motif drag support for XmText and XmTextField widgets in XmFileSelectionDialog is not disabled with unsetting enableUnselectableDrag property, XmText and XmTextField can initiate drag in responce to other events, not only on Btn2Down. New version addresses all the cases. I suggest to track all calls to XmDragStart application-wide and make them fail if the source widget is not an awt_root_shell. This check clearly separates drag operations initiated by Motif default drag support and those initiated in java. In Motif 2.1 there is a clean way for this: on the XmDisplay object install a dragStartCallback, which sets 'doit' field of XmDragStartCallbackStruct to True if the source widget is not equal to the awt_root_shell. In Motif 1.2 there is no such API, so this requires some trickery. First of all we need to include a private Motif header file DragCP.h. Then I suggest to install our own XmDragStartProc procedure into the xmDragContextClassRec structure and keep a pointer to the original routine. The new procedure will call the original one only if the source widget for the drag is equal to the awt_root_shell. The problem is that if we don't call the original routine the XmDragContext object can never be destroyed. This happens because throught Motif 1.2 source base a pointer to the created XmDragContext object returned from XmDragStart is never kept. So in case if we don't invoke the original DragStart routine this object will be lost. To resolve it i suggest to call XtDestroyWidget on the XmDragContext object if we don't call the original routine. This is the most risky part of the fix, since we return a pointer to the destroyed object. But since the object is destroyed if and only if a XmDragStart is called by Motif drag support and Motif never keeps the returned pointer (it always casts XmDragStart to void), i think this is safe enough. With this fix we can remove the code that disables Motif drag support for List. ###@###.### 2001-03-17 ======================================================================