src/solaris/classes/sun/awt/X11/XWindowPeer.java
Print this page
*** 224,234 ****
// Set WM_TRANSIENT_FOR and group_leader
Window t_window = (Window)target;
Window owner = t_window.getOwner();
if (owner != null) {
ownerPeer = (XWindowPeer)owner.getPeer();
! if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("Owner is " + owner);
focusLog.finer("Owner peer is " + ownerPeer);
focusLog.finer("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
focusLog.finer("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
}
--- 224,234 ----
// Set WM_TRANSIENT_FOR and group_leader
Window t_window = (Window)target;
Window owner = t_window.getOwner();
if (owner != null) {
ownerPeer = (XWindowPeer)owner.getPeer();
! if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
focusLog.finer("Owner is " + owner);
focusLog.finer("Owner peer is " + ownerPeer);
focusLog.finer("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
focusLog.finer("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
}
*** 237,247 ****
long ownerWindow = ownerPeer.getWindow();
if (ownerWindow != 0) {
XToolkit.awtLock();
try {
// Set WM_TRANSIENT_FOR
! if (focusLog.isLoggable(PlatformLogger.FINE)) {
focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
+ " for " + Long.toHexString(ownerWindow));
}
setToplevelTransientFor(this, ownerPeer, false, true);
--- 237,247 ----
long ownerWindow = ownerPeer.getWindow();
if (ownerWindow != 0) {
XToolkit.awtLock();
try {
// Set WM_TRANSIENT_FOR
! if (focusLog.isLoggable(PlatformLogger.Level.FINE)) {
focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
+ " for " + Long.toHexString(ownerWindow));
}
setToplevelTransientFor(this, ownerPeer, false, true);
*** 299,318 ****
//read icon images from target
winAttr.iconsInherited = false;
for (Iterator<Image> i = iconImages.iterator(); i.hasNext(); ) {
Image image = i.next();
if (image == null) {
! if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("XWindowPeer.updateIconImages: Skipping the image passed into Java because it's null.");
}
continue;
}
XIconInfo iconInfo;
try {
iconInfo = new XIconInfo(image);
} catch (Exception e){
! if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("XWindowPeer.updateIconImages: Perhaps the image passed into Java is broken. Skipping this icon.");
}
continue;
}
if (iconInfo.isValid()) {
--- 299,318 ----
//read icon images from target
winAttr.iconsInherited = false;
for (Iterator<Image> i = iconImages.iterator(); i.hasNext(); ) {
Image image = i.next();
if (image == null) {
! if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("XWindowPeer.updateIconImages: Skipping the image passed into Java because it's null.");
}
continue;
}
XIconInfo iconInfo;
try {
iconInfo = new XIconInfo(image);
} catch (Exception e){
! if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("XWindowPeer.updateIconImages: Perhaps the image passed into Java is broken. Skipping this icon.");
}
continue;
}
if (iconInfo.isValid()) {
*** 379,389 ****
haveLargeIcon = true;
}
}
}
! if (iconLog.isLoggable(PlatformLogger.FINEST)) {
iconLog.finest(">>> Length_ of buffer of icons data: " + totalLength +
", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON);
}
return result;
--- 379,389 ----
haveLargeIcon = true;
}
}
}
! if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) {
iconLog.finest(">>> Length_ of buffer of icons data: " + totalLength +
", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON);
}
return result;
*** 391,401 ****
/*
* Dumps each icon from the list
*/
static void dumpIcons(java.util.List<XIconInfo> icons) {
! if (iconLog.isLoggable(PlatformLogger.FINEST)) {
iconLog.finest(">>> Sizes of icon images:");
for (Iterator<XIconInfo> i = icons.iterator(); i.hasNext(); ) {
iconLog.finest(" {0}", i.next());
}
}
--- 391,401 ----
/*
* Dumps each icon from the list
*/
static void dumpIcons(java.util.List<XIconInfo> icons) {
! if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) {
iconLog.finest(">>> Sizes of icon images:");
for (Iterator<XIconInfo> i = icons.iterator(); i.hasNext(); ) {
iconLog.finest(" {0}", i.next());
}
}
*** 665,675 ****
public void checkIfOnNewScreen(Rectangle newBounds) {
if (!XToolkit.localEnv.runningXinerama()) {
return;
}
! if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("XWindowPeer: Check if we've been moved to a new screen since we're running in Xinerama mode");
}
int area = newBounds.width * newBounds.height;
int intAmt, vertAmt, horizAmt;
--- 665,675 ----
public void checkIfOnNewScreen(Rectangle newBounds) {
if (!XToolkit.localEnv.runningXinerama()) {
return;
}
! if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("XWindowPeer: Check if we've been moved to a new screen since we're running in Xinerama mode");
}
int area = newBounds.width * newBounds.height;
int intAmt, vertAmt, horizAmt;
*** 702,712 ****
newGC = gds[i].getDefaultConfiguration();
}
}
}
if (newScreenNum != curScreenNum) {
! if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("XWindowPeer: Moved to a new screen");
}
executeDisplayChangedOnEDT(newGC);
}
}
--- 702,712 ----
newGC = gds[i].getDefaultConfiguration();
}
}
}
if (newScreenNum != curScreenNum) {
! if (log.isLoggable(PlatformLogger.Level.FINEST)) {
log.finest("XWindowPeer: Moved to a new screen");
}
executeDisplayChangedOnEDT(newGC);
}
}
*** 777,787 ****
protected void requestXFocus(long time, boolean timeProvided) {
// Since in XAWT focus is synthetic and all basic Windows are
// override_redirect all we can do is check whether our parent
// is active. If it is - we can freely synthesize focus transfer.
// Luckily, this logic is already implemented in requestWindowFocus.
! if (focusLog.isLoggable(PlatformLogger.FINE)) {
focusLog.fine("Requesting window focus");
}
requestWindowFocus(time, timeProvided);
}
--- 777,787 ----
protected void requestXFocus(long time, boolean timeProvided) {
// Since in XAWT focus is synthetic and all basic Windows are
// override_redirect all we can do is check whether our parent
// is active. If it is - we can freely synthesize focus transfer.
// Luckily, this logic is already implemented in requestWindowFocus.
! if (focusLog.isLoggable(PlatformLogger.Level.FINE)) {
focusLog.fine("Requesting window focus");
}
requestWindowFocus(time, timeProvided);
}
*** 805,815 ****
}
public void handleFocusEvent(XEvent xev) {
XFocusChangeEvent xfe = xev.get_xfocus();
FocusEvent fe;
! if (focusLog.isLoggable(PlatformLogger.FINE)) {
focusLog.fine("{0}", xfe);
}
if (isEventDisabled(xev)) {
return;
}
--- 805,815 ----
}
public void handleFocusEvent(XEvent xev) {
XFocusChangeEvent xfe = xev.get_xfocus();
FocusEvent fe;
! if (focusLog.isLoggable(PlatformLogger.Level.FINE)) {
focusLog.fine("{0}", xfe);
}
if (isEventDisabled(xev)) {
return;
}
*** 990,1000 ****
private static boolean isDesktopWindow( long wi ) {
return XWM.getWM().isDesktopWindow( wi );
}
private void updateAlwaysOnTop() {
! if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop));
}
XWM.getWM().setLayer(this,
alwaysOnTop ?
XLayerProtocol.LAYER_ALWAYS_ON_TOP :
--- 990,1000 ----
private static boolean isDesktopWindow( long wi ) {
return XWM.getWM().isDesktopWindow( wi );
}
private void updateAlwaysOnTop() {
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop));
}
XWM.getWM().setLayer(this,
alwaysOnTop ?
XLayerProtocol.LAYER_ALWAYS_ON_TOP :
*** 1172,1182 ****
winAttr.nativeDecor == false;
}
public void dispose() {
if (isGrabbed()) {
! if (grabLog.isLoggable(PlatformLogger.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because of the window disposal", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
}
--- 1172,1182 ----
winAttr.nativeDecor == false;
}
public void dispose() {
if (isGrabbed()) {
! if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because of the window disposal", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
}
*** 1517,1527 ****
try {
// State lock should always be after awtLock
synchronized(getStateLock()) {
XDialogPeer blockerPeer = (XDialogPeer) AWTAccessor.getComponentAccessor().getPeer(d);
if (blocked) {
! if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("{0} is blocked by {1}", this, blockerPeer);
}
modalBlocker = d;
if (isReparented() || XWM.isNonReparentingWM()) {
--- 1517,1527 ----
try {
// State lock should always be after awtLock
synchronized(getStateLock()) {
XDialogPeer blockerPeer = (XDialogPeer) AWTAccessor.getComponentAccessor().getPeer(d);
if (blocked) {
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("{0} is blocked by {1}", this, blockerPeer);
}
modalBlocker = d;
if (isReparented() || XWM.isNonReparentingWM()) {
*** 1910,1920 ****
}
}
@Override
public void xSetVisible(boolean visible) {
! if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("Setting visible on " + this + " to " + visible);
}
XToolkit.awtLock();
try {
this.visible = visible;
--- 1910,1920 ----
}
}
@Override
public void xSetVisible(boolean visible) {
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Setting visible on " + this + " to " + visible);
}
XToolkit.awtLock();
try {
this.visible = visible;
*** 2052,2062 ****
return grab && XAwtState.getGrabWindow() == this;
}
public void handleXCrossingEvent(XEvent xev) {
XCrossingEvent xce = xev.get_xcrossing();
! if (grabLog.isLoggable(PlatformLogger.FINE)) {
grabLog.fine("{0}, when grabbed {1}, contains {2}",
xce, isGrabbed(), containsGlobal(xce.get_x_root(), xce.get_y_root()));
}
if (isGrabbed()) {
// When window is grabbed, all events are dispatched to
--- 2052,2062 ----
return grab && XAwtState.getGrabWindow() == this;
}
public void handleXCrossingEvent(XEvent xev) {
XCrossingEvent xce = xev.get_xcrossing();
! if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
grabLog.fine("{0}, when grabbed {1}, contains {2}",
xce, isGrabbed(), containsGlobal(xce.get_x_root(), xce.get_y_root()));
}
if (isGrabbed()) {
// When window is grabbed, all events are dispatched to
*** 2065,2075 ****
// translation)
// Note that we need to retarget XCrossingEvents to content window
// since it generates MOUSE_ENTERED/MOUSE_EXITED for frame and dialog.
// (fix for 6390326)
XBaseWindow target = XToolkit.windowToXWindow(xce.get_window());
! if (grabLog.isLoggable(PlatformLogger.FINER)) {
grabLog.finer(" - Grab event target {0}", target);
}
if (target != null && target != this) {
target.dispatchEvent(xev);
return;
--- 2065,2075 ----
// translation)
// Note that we need to retarget XCrossingEvents to content window
// since it generates MOUSE_ENTERED/MOUSE_EXITED for frame and dialog.
// (fix for 6390326)
XBaseWindow target = XToolkit.windowToXWindow(xce.get_window());
! if (grabLog.isLoggable(PlatformLogger.Level.FINER)) {
grabLog.finer(" - Grab event target {0}", target);
}
if (target != null && target != this) {
target.dispatchEvent(xev);
return;
*** 2078,2088 ****
super.handleXCrossingEvent(xev);
}
public void handleMotionNotify(XEvent xev) {
XMotionEvent xme = xev.get_xmotion();
! if (grabLog.isLoggable(PlatformLogger.FINER)) {
grabLog.finer("{0}, when grabbed {1}, contains {2}",
xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root()));
}
if (isGrabbed()) {
boolean dragging = false;
--- 2078,2088 ----
super.handleXCrossingEvent(xev);
}
public void handleMotionNotify(XEvent xev) {
XMotionEvent xme = xev.get_xmotion();
! if (grabLog.isLoggable(PlatformLogger.Level.FINER)) {
grabLog.finer("{0}, when grabbed {1}, contains {2}",
xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root()));
}
if (isGrabbed()) {
boolean dragging = false;
*** 2109,2119 ****
xme.set_window(target.getWindow());
Point localCoord = target.toLocal(xme.get_x_root(), xme.get_y_root());
xme.set_x(localCoord.x);
xme.set_y(localCoord.y);
}
! if (grabLog.isLoggable(PlatformLogger.FINER)) {
grabLog.finer(" - Grab event target {0}", target);
}
if (target != null) {
if (target != getContentXWindow() && target != this) {
target.dispatchEvent(xev);
--- 2109,2119 ----
xme.set_window(target.getWindow());
Point localCoord = target.toLocal(xme.get_x_root(), xme.get_y_root());
xme.set_x(localCoord.x);
xme.set_y(localCoord.y);
}
! if (grabLog.isLoggable(PlatformLogger.Level.FINER)) {
grabLog.finer(" - Grab event target {0}", target);
}
if (target != null) {
if (target != getContentXWindow() && target != this) {
target.dispatchEvent(xev);
*** 2143,2153 ****
* One more bit is reserved for FIRST_HIGH_BIT.
*/
if (xbe.get_button() > SunToolkit.MAX_BUTTONS_SUPPORTED) {
return;
}
! if (grabLog.isLoggable(PlatformLogger.FINE)) {
grabLog.fine("{0}, when grabbed {1}, contains {2} ({3}, {4}, {5}x{6})",
xbe, isGrabbed(), containsGlobal(xbe.get_x_root(), xbe.get_y_root()), getAbsoluteX(), getAbsoluteY(), getWidth(), getHeight());
}
if (isGrabbed()) {
// When window is grabbed, all events are dispatched to
--- 2143,2153 ----
* One more bit is reserved for FIRST_HIGH_BIT.
*/
if (xbe.get_button() > SunToolkit.MAX_BUTTONS_SUPPORTED) {
return;
}
! if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
grabLog.fine("{0}, when grabbed {1}, contains {2} ({3}, {4}, {5}x{6})",
xbe, isGrabbed(), containsGlobal(xbe.get_x_root(), xbe.get_y_root()), getAbsoluteX(), getAbsoluteY(), getWidth(), getHeight());
}
if (isGrabbed()) {
// When window is grabbed, all events are dispatched to
*** 2154,2164 ****
// it. Retarget them to the corresponding windows (notice
// that XBaseWindow.dispatchEvent does the opposite
// translation)
XBaseWindow target = XToolkit.windowToXWindow(xbe.get_window());
try {
! if (grabLog.isLoggable(PlatformLogger.FINER)) {
grabLog.finer(" - Grab event target {0} (press target {1})", target, pressTarget);
}
if (xbe.get_type() == XConstants.ButtonPress
&& xbe.get_button() == XConstants.buttons[0])
{
--- 2154,2164 ----
// it. Retarget them to the corresponding windows (notice
// that XBaseWindow.dispatchEvent does the opposite
// translation)
XBaseWindow target = XToolkit.windowToXWindow(xbe.get_window());
try {
! if (grabLog.isLoggable(PlatformLogger.Level.FINER)) {
grabLog.finer(" - Grab event target {0} (press target {1})", target, pressTarget);
}
if (xbe.get_type() == XConstants.ButtonPress
&& xbe.get_button() == XConstants.buttons[0])
{
*** 2190,2200 ****
if ((target == this || target == getContentXWindow()) && !containsGlobal(xbe.get_x_root(), xbe.get_y_root())) {
// Outside this toplevel hierarchy
// According to the specification of UngrabEvent, post it
// when press occurs outside of the window and not on its owned windows
if (xbe.get_type() == XConstants.ButtonPress) {
! if (grabLog.isLoggable(PlatformLogger.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
return;
}
--- 2190,2200 ----
if ((target == this || target == getContentXWindow()) && !containsGlobal(xbe.get_x_root(), xbe.get_y_root())) {
// Outside this toplevel hierarchy
// According to the specification of UngrabEvent, post it
// when press occurs outside of the window and not on its owned windows
if (xbe.get_type() == XConstants.ButtonPress) {
! if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
return;
}
*** 2211,2236 ****
}
if (w == null || (w != this.target && w instanceof Dialog)) {
// toplevel == null - outside of
// hierarchy, toplevel is Dialog - should
// send ungrab (but shouldn't for Window)
! if (grabLog.isLoggable(PlatformLogger.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because hierarchy ended", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
}
} else {
// toplevel is null - outside of hierarchy
! if (grabLog.isLoggable(PlatformLogger.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because toplevel is null", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
return;
}
} else {
// target doesn't map to XAWT window - outside of hierarchy
! if (grabLog.isLoggable(PlatformLogger.FINE)) {
grabLog.fine("Generating UngrabEvent on because target is null {0}", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
return;
}
--- 2211,2236 ----
}
if (w == null || (w != this.target && w instanceof Dialog)) {
// toplevel == null - outside of
// hierarchy, toplevel is Dialog - should
// send ungrab (but shouldn't for Window)
! if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because hierarchy ended", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
}
} else {
// toplevel is null - outside of hierarchy
! if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
grabLog.fine("Generating UngrabEvent on {0} because toplevel is null", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
return;
}
} else {
// target doesn't map to XAWT window - outside of hierarchy
! if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
grabLog.fine("Generating UngrabEvent on because target is null {0}", this);
}
postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
return;
}