JDK-6176814 : Metalworks frame maximizes after the move
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,linux,windows_xp
  • CPU: generic,x86
  • Submitted: 2004-10-11
  • Updated: 2022-08-30
  • Resolved: 2005-02-12
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 JDK 6
5.0u4Fixed 6 b24Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Run Metalworks demo on Linux (XToolkit)
Press left mouse button on a title and move the frame around
Release the button - the frame will become maximized

Regression from 1.4.2, XToolkit-only behavior
###@###.### 10/11/04 09:09 GMT

Reproducible with any JFrame that has DefaultLookAndFeelDecorated set to true.
###@###.### 10/13/04 14:51 GMT

Comments
SUGGESTED FIX *** /tmp/geta5845 --- XWindow.java *************** *** 26,32 **** private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XWindow"); private static Logger eventLog = Logger.getLogger("sun.awt.X11.event.XWindow"); private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XWindow"); ! // ButtonXXX events stuff static int rbutton = 0; static int lastX = 0, lastY = 0; --- 26,36 ---- private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XWindow"); private static Logger eventLog = Logger.getLogger("sun.awt.X11.event.XWindow"); private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XWindow"); ! /* If a motion comes in while a multi-click is pending, ! * allow a smudge factor so that moving the mouse by a small ! * amount does not wipe out the multi-click state variables. ! */ ! private final static int AWT_MULTICLICK_SMUDGE = 4; // ButtonXXX events stuff static int rbutton = 0; static int lastX = 0, lastY = 0; *************** *** 614,624 **** if (isEventDisabled(xme)) { return; } ! /* To be done : ! add multiclick checking */ ! clickCount = 0; ! //lastWindowRef = null; long jWhen = XToolkit.nowMillisUTC_offset(xme.get_time()); int modifiers = getModifiers(xme.get_state(),0,0); --- 618,640 ---- if (isEventDisabled(xme)) { return; } ! /* ! Fix for 6176814 . Add multiclick checking. */ ! int x = xme.get_x(); ! int y = xme.get_y(); ! XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null); ! ! if (!(lastWindow == this && ! (xme.get_time() - lastTime) < XToolkit.getMultiClickTime() && ! (Math.abs(lastX - x) < AWT_MULTICLICK_SMUDGE && ! Math.abs(lastY - y) < AWT_MULTICLICK_SMUDGE))) { ! clickCount = 0; ! lastWindowRef = null; ! lastTime = 0; ! lastX = 0; ! lastY = 0; ! } long jWhen = XToolkit.nowMillisUTC_offset(xme.get_time()); int modifiers = getModifiers(xme.get_state(),0,0); *************** *** 629,636 **** MouseEvent.MOUSE_MOVED; Component source = (Component)getEventSource(); - int x = xme.get_x(); - int y = xme.get_y(); if (xme.get_window() != window) { Point localXY = toLocal(xme.get_x_root(), xme.get_y_root()); x = localXY.x; --- 645,650 ---- ###@###.### 2004-12-01 08:59:31 GMT
01-12-2004

EVALUATION Should drop lastWindowRef to null in XWindow.java:handleMotionNotify() if mouse had been moving. This way we could avoid extra MouseClickEvent if we had dragged the mouse between MousePress and MouseRelease. According to MToolkit implementation (canvas.c), this is the correct behaviour. ###@###.### 10/13/04 14:41 GMT See also bug 6179679 which I've just closed as a duplicate. Also, I see 5039416 in the "see also" section and it sounds VERY similar. Are they the same bug or slightly different? ###@###.### 2004-11-19 20:08:40 GMT The fix for this bug is not delivered into JDK5.0_01. It will appear in JDK5.0_04. ###@###.### 2005-03-09 08:59:35 GMT Our XWindow.java code lack of multiclick handling. So, when user drags mouse on the screen on Linux box this leads to delivering double clicks when user expects single clicks and single click when user expects no clicks at all. To fix this we introduced AWT_MULTICLICK_SMUDGE variable to describe an area (actually this is a rectangle) where mouse moves with holding mouse button treated as non_dragging moves (in this case we suppose that user just want to click multiple times). If user moved mouse a lot and leaves the SMUDGE_AREA we change our local variables and supress an additional MOUSE_CLICK generation ( we suppose that user started dragging ). ###@###.### 2005-03-09 09:09:39 GMT There is a complete information about our plans for this CR: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=2123586 ###@###.### 2005-06-17 08:02:28 GMT
13-10-2004