src/solaris/classes/sun/awt/X11/XWM.java
Print this page
*** 146,156 ****
static final Insets defaultInsets = new Insets(25, 5, 5, 5);
XWM(int WMID) {
this.WMID = WMID;
initializeProtocols();
! if (log.isLoggable(PlatformLogger.FINE)) log.fine("Window manager: " + toString());
}
int getID() {
return WMID;
}
--- 146,158 ----
static final Insets defaultInsets = new Insets(25, 5, 5, 5);
XWM(int WMID) {
this.WMID = WMID;
initializeProtocols();
! if (log.isLoggable(PlatformLogger.FINE)) {
! log.fine("Window manager: " + toString());
! }
}
int getID() {
return WMID;
}
*** 250,260 ****
/*
* Use NO_WM since in all other aspects eXcursion is like not
* having a window manager running. I.e. it does not reparent
* top level shells.
*/
! if (insLog.isLoggable(PlatformLogger.FINE)) {
insLog.finer("eXcursion means NO_WM");
}
return true;
}
--- 252,262 ----
/*
* Use NO_WM since in all other aspects eXcursion is like not
* having a window manager running. I.e. it does not reparent
* top level shells.
*/
! if (insLog.isLoggable(PlatformLogger.FINER)) {
insLog.finer("eXcursion means NO_WM");
}
return true;
}
*** 268,278 ****
final String selection_name = "WM_S" + default_screen_number;
long selection_owner =
XlibWrapper.XGetSelectionOwner(XToolkit.getDisplay(),
XAtom.get(selection_name).getAtom());
! if (insLog.isLoggable(PlatformLogger.FINE)) {
insLog.finer("selection owner of " + selection_name
+ " is " + selection_owner);
}
if (selection_owner != XConstants.None) {
--- 270,280 ----
final String selection_name = "WM_S" + default_screen_number;
long selection_owner =
XlibWrapper.XGetSelectionOwner(XToolkit.getDisplay(),
XAtom.get(selection_name).getAtom());
! if (insLog.isLoggable(PlatformLogger.FINER)) {
insLog.finer("selection owner of " + selection_name
+ " is " + selection_owner);
}
if (selection_owner != XConstants.None) {
*** 297,307 ****
substruct.set_event_mask(0);
XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
XToolkit.getDefaultRootWindow(),
XConstants.CWEventMask,
substruct.pData);
! if (insLog.isLoggable(PlatformLogger.FINE)) {
insLog.finer("It looks like there is no WM thus NO_WM");
}
}
return !winmgr_running;
--- 299,309 ----
substruct.set_event_mask(0);
XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
XToolkit.getDefaultRootWindow(),
XConstants.CWEventMask,
substruct.pData);
! if (insLog.isLoggable(PlatformLogger.FINER)) {
insLog.finer("It looks like there is no WM thus NO_WM");
}
}
return !winmgr_running;
*** 341,362 ****
--- 343,372 ----
// Convert data to String, ASCII
byte[] bytes = XlibWrapper.getStringBytes(getter.getData());
String id = new String(bytes);
+ if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("ENLIGHTENMENT_COMMS is " + id);
+ }
// Parse WINID
Pattern winIdPat = Pattern.compile("WINID\\s+(\\p{XDigit}{0,8})");
try {
Matcher match = winIdPat.matcher(id);
if (match.matches()) {
+ if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("Match group count: " + match.groupCount());
+ }
String longId = match.group(1);
+ if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("Match group 1 " + longId);
+ }
long winid = Long.parseLong(longId, 16);
+ if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Enlightenment communication window " + winid);
+ }
return winid;
} else {
log.finer("ENLIGHTENMENT_COMMS has wrong format");
return 0;
}
*** 652,662 ****
--- 662,674 ----
XA_ICEWM_WINOPTHINT, 0, 0xFFFF,
true, XA_ICEWM_WINOPTHINT);
try {
int status = getter.execute();
boolean res = (status == XConstants.Success && getter.getActualType() != 0);
+ if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res);
+ }
return !res || isNetWMName("IceWM");
} finally {
getter.dispose();
}
}
*** 814,824 ****
if ((hints.get_flags() & mask) == 0) {
return;
}
hints.set_flags(hints.get_flags() & ~mask);
! if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(),
window.getWindow(),
hints.pData);
} finally {
XToolkit.awtUnlock();
--- 826,838 ----
if ((hints.get_flags() & mask) == 0) {
return;
}
hints.set_flags(hints.get_flags() & ~mask);
! if (insLog.isLoggable(PlatformLogger.FINER)) {
! insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
! }
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(),
window.getWindow(),
hints.pData);
} finally {
XToolkit.awtUnlock();
*** 871,881 ****
return;
}
XAtomList decorDel = new XAtomList();
decorations = normalizeMotifDecor(decorations);
! if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
decorDel.add(XA_OL_DECOR_HEADER);
}
if ((decorations & (MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE)) == 0) {
decorDel.add(XA_OL_DECOR_RESIZE);
--- 885,897 ----
return;
}
XAtomList decorDel = new XAtomList();
decorations = normalizeMotifDecor(decorations);
! if (insLog.isLoggable(PlatformLogger.FINER)) {
! insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
! }
if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
decorDel.add(XA_OL_DECOR_HEADER);
}
if ((decorations & (MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE)) == 0) {
decorDel.add(XA_OL_DECOR_RESIZE);
*** 888,898 ****
}
if (decorDel.size() == 0) {
insLog.finer("Deleting OL_DECOR");
XA_OL_DECOR_DEL.DeleteProperty(window);
} else {
! if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + decorDel);
XA_OL_DECOR_DEL.setAtomListProperty(window, decorDel);
}
}
/*
--- 904,916 ----
}
if (decorDel.size() == 0) {
insLog.finer("Deleting OL_DECOR");
XA_OL_DECOR_DEL.DeleteProperty(window);
} else {
! if (insLog.isLoggable(PlatformLogger.FINER)) {
! insLog.finer("Setting OL_DECOR to " + decorDel);
! }
XA_OL_DECOR_DEL.setAtomListProperty(window, decorDel);
}
}
/*
*** 916,926 ****
MWMConstants.MWM_HINTS_FUNCTIONS |
MWMConstants.MWM_HINTS_DECORATIONS);
hints.set_functions(functions);
hints.set_decorations(decorations);
! if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("Setting MWM_HINTS to " + hints);
window.setMWMHints(hints);
}
/*
* Under some window managers if shell is already mapped, we MUST
--- 934,946 ----
MWMConstants.MWM_HINTS_FUNCTIONS |
MWMConstants.MWM_HINTS_DECORATIONS);
hints.set_functions(functions);
hints.set_decorations(decorations);
! if (stateLog.isLoggable(PlatformLogger.FINER)) {
! stateLog.finer("Setting MWM_HINTS to " + hints);
! }
window.setMWMHints(hints);
}
/*
* Under some window managers if shell is already mapped, we MUST
*** 978,988 ****
/*
* Make specified shell resizable.
*/
static void setShellResizable(XDecoratedPeer window) {
! if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell resizable " + window);
XToolkit.awtLock();
try {
Rectangle shellBounds = window.getShellBounds();
shellBounds.translate(-window.currentInsets.left, -window.currentInsets.top);
window.updateSizeHints(window.getDimensions());
--- 998,1010 ----
/*
* Make specified shell resizable.
*/
static void setShellResizable(XDecoratedPeer window) {
! if (insLog.isLoggable(PlatformLogger.FINE)) {
! insLog.fine("Setting shell resizable " + window);
! }
XToolkit.awtLock();
try {
Rectangle shellBounds = window.getShellBounds();
shellBounds.translate(-window.currentInsets.left, -window.currentInsets.top);
window.updateSizeHints(window.getDimensions());
*** 1008,1019 ****
* @param shellBounds bounds of the shell window
*/
static void setShellNotResizable(XDecoratedPeer window, WindowDimensions newDimensions, Rectangle shellBounds,
boolean justChangeSize)
{
! if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
", shellBounds " + shellBounds +", just change size: " + justChangeSize);
XToolkit.awtLock();
try {
/* Fix min/max size hints at the specified values */
if (!shellBounds.isEmpty()) {
window.updateSizeHints(newDimensions);
--- 1030,1043 ----
* @param shellBounds bounds of the shell window
*/
static void setShellNotResizable(XDecoratedPeer window, WindowDimensions newDimensions, Rectangle shellBounds,
boolean justChangeSize)
{
! if (insLog.isLoggable(PlatformLogger.FINE)) {
! insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
", shellBounds " + shellBounds +", just change size: " + justChangeSize);
+ }
XToolkit.awtLock();
try {
/* Fix min/max size hints at the specified values */
if (!shellBounds.isEmpty()) {
window.updateSizeHints(newDimensions);
*** 1140,1160 ****
--- 1164,1188 ----
int wm_state = window.getWMState();
if (wm_state == XUtilConstants.WithdrawnState) {
stateLog.finer("WithdrawnState");
return false;
} else {
+ if (stateLog.isLoggable(PlatformLogger.FINER)) {
stateLog.finer("Window WM_STATE is " + wm_state);
}
+ }
boolean is_state_change = false;
if (e.get_atom() == XA_WM_STATE.getAtom()) {
is_state_change = true;
}
for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
is_state_change |= proto.isStateChange(e);
+ if (stateLog.isLoggable(PlatformLogger.FINEST)) {
stateLog.finest(proto + ": is state changed = " + is_state_change);
}
+ }
return is_state_change;
}
/*
* Returns current state (including extended) of a given window.
*** 1301,1311 ****
case OPENLOOK_WM:
default:
res = defaultInsets;
}
}
! if (insLog.isLoggable(PlatformLogger.FINEST)) insLog.finest("WM guessed insets: " + res);
return res;
}
/*
* Some buggy WMs ignore window gravity when processing
* ConfigureRequest and position window as if the gravity is Static.
--- 1329,1341 ----
case OPENLOOK_WM:
default:
res = defaultInsets;
}
}
! if (insLog.isLoggable(PlatformLogger.FINEST)) {
! insLog.finest("WM guessed insets: " + res);
! }
return res;
}
/*
* Some buggy WMs ignore window gravity when processing
* ConfigureRequest and position window as if the gravity is Static.