JDK-6856929 : Frame is not getting resized using Robot in OpenSolaris and Ubuntu
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: generic
  • Submitted: 2009-07-02
  • Updated: 2011-01-19
  • Resolved: 2009-08-05
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.
7 b68Fixed
Related Reports
Relates :  
Frame is not getting resized using Robot. This I reproduced with Jdk7 b62 build on Ubuntu 8.04 and OpenSolaris 2009.06. Worked fine with Jdk 7 6u14 build.

Steps to reproduce:

1. Run the attached testcase (ResizeFrame.java)
java ResizeFrame
2. Notice the frame is not getting resized.

EVALUATION It's regression of the fix for 6315717 (Support For Mouse With Multiple Scroll Wheels and 4 or More Buttons). Caused by the following change: src/solaris/native/sun/awt/awt_Robot.c In the mouseAction function the following code was added ! if (num_buttons > 3){ ! int32_t i; ! int32_t button = 0; ! for (i = 3; i<num_buttons; i++){ ! if ((buttonMask & masks[i])) { ! // arrays starts from zero index => +1 ! // users wants to affect 4 or 5 button but they are assigned ! // to the wheel so => we have to shift it to the right by 2. ! button = i + 3; ! XTestFakeButtonEvent(awt_display, button, isMousePress, CurrentTime); ! } ! } ! } num_buttons is XButtonInfo->num_buttons and it contains the number of button that the mouse has. This value equals 32 on my environment. At the same time, the length of the masks array equals 20 (defined on Java level in the InputEvent class) and masks[i] for any invalid index values will return unexpected data and this may cause to additional XTestFakeButtonEvent call. In the attached testcase, XTestFakeButtonEvent is called at least 5 times during one mouse press. RobotPeer: XTestFakeButtonEvent button=1,press=1 RobotPeer: XTestFakeButtonEvent button=25,press=1 RobotPeer: XTestFakeButtonEvent button=29,press=1 RobotPeer: XTestFakeButtonEvent button=32,press=1 RobotPeer: XTestFakeButtonEvent button=33,press=1 Xerror BadValue (integer parameter out of range for operation), XID 21, ser# 216 Major opcode 132 (Unknown) Minor opcode 2