src/solaris/classes/sun/awt/X11/XToolkit.java
Print this page
*** 264,274 ****
}
if (xs != null) {
((XAWTXSettings)xs).dispose();
}
freeXKB();
! if (log.isLoggable(PlatformLogger.FINE)) {
dumpPeers();
}
}
};
shutdownThread.setContextClassLoader(null);
--- 264,274 ----
}
if (xs != null) {
((XAWTXSettings)xs).dispose();
}
freeXKB();
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
dumpPeers();
}
}
};
shutdownThread.setContextClassLoader(null);
*** 522,532 ****
}
notifyListeners(ev);
}
static void processException(Throwable thr) {
! if (log.isLoggable(PlatformLogger.WARNING)) {
log.warning("Exception on Toolkit thread", thr);
}
}
static native void awt_toolkit_init();
--- 522,532 ----
}
notifyListeners(ev);
}
static void processException(Throwable thr) {
! if (log.isLoggable(PlatformLogger.Level.WARNING)) {
log.warning("Exception on Toolkit thread", thr);
}
}
static native void awt_toolkit_init();
*** 584,594 ****
if (XDropTargetEventProcessor.processEvent(ev) ||
XDragSourceContextPeer.processEvent(ev)) {
continue;
}
! if (eventLog.isLoggable(PlatformLogger.FINER)) {
eventLog.finer("{0}", ev);
}
// Check if input method consumes the event
long w = 0;
--- 584,594 ----
if (XDropTargetEventProcessor.processEvent(ev) ||
XDragSourceContextPeer.processEvent(ev)) {
continue;
}
! if (eventLog.isLoggable(PlatformLogger.Level.FINER)) {
eventLog.finer("{0}", ev);
}
// Check if input method consumes the event
long w = 0;
*** 600,616 ****
if (ownerWindow != null) {
w = ownerWindow.getContentWindow();
}
}
}
! if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
keyEventLog.fine("before XFilterEvent:"+ev);
}
if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
continue;
}
! if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
}
dispatchEvent(ev);
} catch (ThreadDeath td) {
--- 600,616 ----
if (ownerWindow != null) {
w = ownerWindow.getContentWindow();
}
}
}
! if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
keyEventLog.fine("before XFilterEvent:"+ev);
}
if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
continue;
}
! if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
}
dispatchEvent(ev);
} catch (ThreadDeath td) {
*** 1319,1329 ****
return XWM.getWM().supportsExtendedState(state);
}
}
static void dumpPeers() {
! if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("Mapped windows:");
Iterator iter = winMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
log.fine(entry.getKey() + "->" + entry.getValue());
--- 1319,1329 ----
return XWM.getWM().supportsExtendedState(state);
}
}
static void dumpPeers() {
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Mapped windows:");
Iterator iter = winMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
log.fine(entry.getKey() + "->" + entry.getValue());
*** 1415,1425 ****
awtLockWait();
}
}
} catch (InterruptedException ie) {
// Note: the returned timeStamp can be incorrect in this case.
! if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")");
}
}
} finally {
awtUnlock();
--- 1415,1425 ----
awtLockWait();
}
}
} catch (InterruptedException ie) {
// Note: the returned timeStamp can be incorrect in this case.
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")");
}
}
} finally {
awtUnlock();
*** 1582,1592 ****
Map.Entry e = (Map.Entry)i.next();
String name = (String)e.getKey();
name = "gnome." + name;
setDesktopProperty(name, e.getValue());
! if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("name = " + name + " value = " + e.getValue());
}
// XXX: we probably want to do something smarter. In
// particular, "Net" properties are of interest to the
--- 1582,1592 ----
Map.Entry e = (Map.Entry)i.next();
String name = (String)e.getKey();
name = "gnome." + name;
setDesktopProperty(name, e.getValue());
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("name = " + name + " value = " + e.getValue());
}
// XXX: we probably want to do something smarter. In
// particular, "Net" properties are of interest to the
*** 1771,1781 ****
}
XlibWrapper.XFreeModifiermap(modmap.pData);
} finally {
awtUnlock();
}
! if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("metaMask = " + metaMask);
log.fine("altMask = " + altMask);
log.fine("numLockMask = " + numLockMask);
log.fine("modeSwitchMask = " + modeSwitchMask);
log.fine("modLockIsShiftLock = " + modLockIsShiftLock);
--- 1771,1781 ----
}
XlibWrapper.XFreeModifiermap(modmap.pData);
} finally {
awtUnlock();
}
! if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("metaMask = " + metaMask);
log.fine("altMask = " + altMask);
log.fine("numLockMask = " + numLockMask);
log.fine("modeSwitchMask = " + modeSwitchMask);
log.fine("modLockIsShiftLock = " + modLockIsShiftLock);
*** 1793,1807 ****
if (task == null) {
throw new NullPointerException("task is null");
}
awtLock();
try {
! if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
timeoutTaskLog.finer("Removing task " + task);
}
if (timeoutTasks == null) {
! if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
timeoutTaskLog.finer("Task is not scheduled");
}
return;
}
Collection values = timeoutTasks.values();
--- 1793,1807 ----
if (task == null) {
throw new NullPointerException("task is null");
}
awtLock();
try {
! if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) {
timeoutTaskLog.finer("Removing task " + task);
}
if (timeoutTasks == null) {
! if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) {
timeoutTaskLog.finer("Task is not scheduled");
}
return;
}
Collection values = timeoutTasks.values();
*** 1844,1854 ****
throw new IllegalArgumentException("interval " + interval + " is not positive");
}
awtLock();
try {
! if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
timeoutTaskLog.finer("XToolkit.schedule(): current time={0}" +
"; interval={1}" +
"; task being added={2}" + "; tasks before addition={3}",
Long.valueOf(System.currentTimeMillis()), Long.valueOf(interval), task, timeoutTasks);
}
--- 1844,1854 ----
throw new IllegalArgumentException("interval " + interval + " is not positive");
}
awtLock();
try {
! if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) {
timeoutTaskLog.finer("XToolkit.schedule(): current time={0}" +
"; interval={1}" +
"; task being added={2}" + "; tasks before addition={3}",
Long.valueOf(System.currentTimeMillis()), Long.valueOf(interval), task, timeoutTasks);
}
*** 1891,1901 ****
/**
* Executes mature timeout tasks registered with schedule().
* Called from run() under awtLock.
*/
private static void callTimeoutTasks() {
! if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" +
"; tasks={1}", Long.valueOf(System.currentTimeMillis()), timeoutTasks);
}
if (timeoutTasks == null || timeoutTasks.isEmpty()) {
--- 1891,1901 ----
/**
* Executes mature timeout tasks registered with schedule().
* Called from run() under awtLock.
*/
private static void callTimeoutTasks() {
! if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) {
timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" +
"; tasks={1}", Long.valueOf(System.currentTimeMillis()), timeoutTasks);
}
if (timeoutTasks == null || timeoutTasks.isEmpty()) {
*** 1909,1919 ****
java.util.List tasks = (java.util.List)timeoutTasks.remove(time);
for (Iterator iter = tasks.iterator(); iter.hasNext();) {
Runnable task = (Runnable)iter.next();
! if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) {
timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" +
"; about to run task={1}", Long.valueOf(currentTime), task);
}
try {
--- 1909,1919 ----
java.util.List tasks = (java.util.List)timeoutTasks.remove(time);
for (Iterator iter = tasks.iterator(); iter.hasNext();) {
Runnable task = (Runnable)iter.next();
! if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) {
timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" +
"; about to run task={1}", Long.valueOf(currentTime), task);
}
try {
*** 1984,2003 ****
* we should not attempt to remove the wrap checking even if _LP64 is
* true.
*/
long current_time_utc = System.currentTimeMillis();
! if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("reset_time=" + reset_time_utc + ", current_time=" + current_time_utc
+ ", server_offset=" + server_offset + ", wrap_time=" + WRAP_TIME_MILLIS);
}
if ((current_time_utc - reset_time_utc) > WRAP_TIME_MILLIS) {
reset_time_utc = System.currentTimeMillis() - getCurrentServerTime();
}
! if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("result = " + (reset_time_utc + server_offset));
}
return reset_time_utc + server_offset;
}
--- 1984,2003 ----
* we should not attempt to remove the wrap checking even if _LP64 is
* true.
*/
long current_time_utc = System.currentTimeMillis();
! if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("reset_time=" + reset_time_utc + ", current_time=" + current_time_utc
+ ", server_offset=" + server_offset + ", wrap_time=" + WRAP_TIME_MILLIS);
}
if ((current_time_utc - reset_time_utc) > WRAP_TIME_MILLIS) {
reset_time_utc = System.currentTimeMillis() - getCurrentServerTime();
}
! if (log.isLoggable(PlatformLogger.Level.FINER)) {
log.finer("result = " + (reset_time_utc + server_offset));
}
return reset_time_utc + server_offset;
}
*** 2072,2089 ****
String prop = (String)AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("sun.awt.backingStore"));
if (prop == null) {
backingStoreType = XConstants.NotUseful;
! if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
backingStoreLog.config("The system property sun.awt.backingStore is not set" +
", by default backingStore=NotUseful");
}
return;
}
! if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
backingStoreLog.config("The system property sun.awt.backingStore is " + prop);
}
prop = prop.toLowerCase();
if (prop.equals("always")) {
backingStoreType = XConstants.Always;
--- 2072,2089 ----
String prop = (String)AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("sun.awt.backingStore"));
if (prop == null) {
backingStoreType = XConstants.NotUseful;
! if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) {
backingStoreLog.config("The system property sun.awt.backingStore is not set" +
", by default backingStore=NotUseful");
}
return;
}
! if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) {
backingStoreLog.config("The system property sun.awt.backingStore is " + prop);
}
prop = prop.toLowerCase();
if (prop.equals("always")) {
backingStoreType = XConstants.Always;
*** 2091,2111 ****
backingStoreType = XConstants.WhenMapped;
} else {
backingStoreType = XConstants.NotUseful;
}
! if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
backingStoreLog.config("backingStore(as provided by the system property)=" +
( backingStoreType == XConstants.NotUseful ? "NotUseful"
: backingStoreType == XConstants.WhenMapped ?
"WhenMapped" : "Always") );
}
if (sun.java2d.x11.X11SurfaceData.isDgaAvailable()) {
backingStoreType = XConstants.NotUseful;
! if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
backingStoreLog.config("DGA is available, backingStore=NotUseful");
}
return;
}
--- 2091,2111 ----
backingStoreType = XConstants.WhenMapped;
} else {
backingStoreType = XConstants.NotUseful;
}
! if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) {
backingStoreLog.config("backingStore(as provided by the system property)=" +
( backingStoreType == XConstants.NotUseful ? "NotUseful"
: backingStoreType == XConstants.WhenMapped ?
"WhenMapped" : "Always") );
}
if (sun.java2d.x11.X11SurfaceData.isDgaAvailable()) {
backingStoreType = XConstants.NotUseful;
! if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) {
backingStoreLog.config("DGA is available, backingStore=NotUseful");
}
return;
}
*** 2116,2126 ****
for (int i = 0; i < screenCount; i++) {
if (XlibWrapper.DoesBackingStore(XlibWrapper.ScreenOfDisplay(getDisplay(), i))
== XConstants.NotUseful) {
backingStoreType = XConstants.NotUseful;
! if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) {
backingStoreLog.config("Backing store is not available on the screen " +
i + ", backingStore=NotUseful");
}
return;
--- 2116,2126 ----
for (int i = 0; i < screenCount; i++) {
if (XlibWrapper.DoesBackingStore(XlibWrapper.ScreenOfDisplay(getDisplay(), i))
== XConstants.NotUseful) {
backingStoreType = XConstants.NotUseful;
! if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) {
backingStoreLog.config("Backing store is not available on the screen " +
i + ", backingStore=NotUseful");
}
return;
*** 2394,2404 ****
oops_updated = false;
oops_failed = false;
// Wait for selection notify for oops on win
long event_number = getEventNumber();
XAtom atom = XAtom.get("WM_S0");
! if (eventLog.isLoggable(PlatformLogger.FINER)) {
eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom()));
}
XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
XAtom.get("VERSION").getAtom(), oops.getAtom(),
win.getWindow(), XConstants.CurrentTime);
--- 2394,2404 ----
oops_updated = false;
oops_failed = false;
// Wait for selection notify for oops on win
long event_number = getEventNumber();
XAtom atom = XAtom.get("WM_S0");
! if (eventLog.isLoggable(PlatformLogger.Level.FINER)) {
eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom()));
}
XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
XAtom.get("VERSION").getAtom(), oops.getAtom(),
win.getWindow(), XConstants.CurrentTime);