src/solaris/classes/sun/awt/X11/XWindow.java
Print this page
rev 9830 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by: darcy, prr
*** 57,67 ****
// ButtonXXX events stuff
static int rbutton = 0;
static int lastX = 0, lastY = 0;
static long lastTime = 0;
static long lastButton = 0;
! static WeakReference lastWindowRef = null;
static int clickCount = 0;
// used to check if we need to re-create surfaceData.
int oldWidth = -1;
int oldHeight = -1;
--- 57,67 ----
// ButtonXXX events stuff
static int rbutton = 0;
static int lastX = 0, lastY = 0;
static long lastTime = 0;
static long lastButton = 0;
! static WeakReference<XWindow> lastWindowRef = null;
static int clickCount = 0;
// used to check if we need to re-create surfaceData.
int oldWidth = -1;
int oldHeight = -1;
*** 690,700 ****
}
if (type == XConstants.ButtonPress) {
//Allow this mouse button to generate CLICK event on next ButtonRelease
mouseButtonClickAllowed |= XlibUtil.getButtonMask(lbutton);
! XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null);
/*
multiclick checking
*/
if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
eventLog.finest("lastWindow = " + lastWindow + ", lastButton "
--- 690,700 ----
}
if (type == XConstants.ButtonPress) {
//Allow this mouse button to generate CLICK event on next ButtonRelease
mouseButtonClickAllowed |= XlibUtil.getButtonMask(lbutton);
! XWindow lastWindow = (lastWindowRef != null) ? (lastWindowRef.get()):(null);
/*
multiclick checking
*/
if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
eventLog.finest("lastWindow = " + lastWindow + ", lastButton "
*** 703,713 ****
}
if (lastWindow == this && lastButton == lbutton && (when - lastTime) < XToolkit.getMultiClickTime()) {
clickCount++;
} else {
clickCount = 1;
! lastWindowRef = new WeakReference(this);
lastButton = lbutton;
lastX = x;
lastY = y;
}
lastTime = when;
--- 703,713 ----
}
if (lastWindow == this && lastButton == lbutton && (when - lastTime) < XToolkit.getMultiClickTime()) {
clickCount++;
} else {
clickCount = 1;
! lastWindowRef = new WeakReference<>(this);
lastButton = lbutton;
lastX = x;
lastY = y;
}
lastTime = when;
*** 818,828 ****
/*
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))) {
--- 818,828 ----
/*
Fix for 6176814 . Add multiclick checking.
*/
int x = xme.get_x();
int y = xme.get_y();
! XWindow lastWindow = (lastWindowRef != null) ? (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))) {