JDK-4327639 : MouseDragged ,Mouse Released is not triggered by TextArea for Middlemouse button
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2000-04-04
  • Updated: 2000-10-11
  • Resolved: 2000-09-06
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.0 betaFixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
In Windows,MouseDragged,MouseReleased Events are not triggered by TextArea for Middle mouse button when mouse is dragged and Released outside the component. 

How to reproduce the Bug? -------->
Run this sample code. You would see a frame with a textarea at the North.
Press the Left/Middle mouse button inside the textarea and drag it.
Drag the mouse outside the textarea and drag it all over the screen without
releasing the mouse button. Release the mouse button when mouse pointer
is outside the textarea. Check whether Mouse Dragged Event,Mouse Released
Events are triggering for textarea or not. 

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

EVALUATION Commit to fix in Merlin (SQE yellow bug). eric.hawkes@eng 2000-05-07 Name: biR10147 Date: 09/01/2000 ###@###.### The only way to deliver mouse events to the components when the mouse is outside the window is to capture the mouse on each pressing. AwtComponent defines standard behavior, and AwtTextArea inherits it. ======================================================================
11-06-2004

SUGGESTED FIX Name: biR10147 Date: 09/01/2000 ###@###.### Capture the mouse over a component where dragging started so mouse events could be delivered to the components properly. ------- awt_Component.h ------- *************** *** 500,505 **** --- 500,507 ---- BOOL m_dragged; /* in drag operation */ virtual INLINE HWND GetWrappeeHandle() { return NULL; } + virtual void AwtComponent::SetDragCapture(); + virtual void AwtComponent::ReleaseDragCapture(); private: ------- awt_Component.cpp ------- *************** *** 3749,3754 **** --- 3749,3764 ---- env->DeleteLocalRef(target); } + void AwtComponent::SetDragCapture() + { + ::SetCapture(GetHWnd()); + } + + void AwtComponent::ReleaseDragCapture() + { + ::ReleaseCapture(); + } + void AwtComponent::SendMouseEvent(long id, jlong when, long x, long y, long modifiers, long clickCount, long popupTrigger, *************** *** 3795,3800 **** --- 3805,3819 ---- env->ExceptionDescribe(); env->ExceptionClear(); } + + if (id == java_awt_event_MouseEvent_MOUSE_PRESSED) { + SetDragCapture(); + } + + if (id == java_awt_event_MouseEvent_MOUSE_RELEASED) { + ReleaseDragCapture(); + } + DASSERT(mouseEvent != NULL); if (pMsg != 0) { AwtAWTEvent::saveMSG(env, pMsg, mouseEvent); ======================================================================
11-06-2004