/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XWindowPeer");
private static final PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XWindowPeer");
private static final PlatformLogger grabLog = PlatformLogger.getLogger("sun.awt.X11.grab.XWindowPeer");
private static final PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XWindowPeer");
// should be synchronized on awtLock
private boolean cachedFocusableWindow;
private boolean alwaysOnTop;
private boolean locationByPlatform;
boolean delayedModalBlocking = false;
// used for modal blocking to keep existing z-order
// value of WM_TRANSIENT_FOR hint set on this window
/*
* Focus related flags
*/
// setVisible(true) & handleMapNotify().
/**
* The type of the window.
*
* The type is supposed to be immutable while the peer object exists.
* The value gets initialized in the preInit() method.
*/
return windowType;
}
// It need to be accessed from XFramePeer.
protected Vector <ToplevelStateListener> toplevelStateListeners = new Vector<ToplevelStateListener>();
}
super(new XCreateWindowParams(new Object[] {
}
/*
* This constant defines icon size recommended for using.
* Apparently, we should use XGetIconSizes which should
* return icon sizes would be most appreciated by the WM.
* However, XGetIconSizes always returns 0 for some reason.
* So the constant has been introduced.
*/
/*
* Sometimes XChangeProperty(_NET_WM_ICON) doesn't work if
* image buffer is too large. This constant holds maximum
* length of buffer which can be used with _NET_WM_ICON hint.
* It holds int's value.
*/
long eventMask = 0;
}
try {
} finally {
}
if (f == null) {
f = XWindow.getDefaultFont();
// we should not call setFont because it will call a repaint
// which the peer may not be ready to do yet.
}
if (c == null) {
// we should not call setBackGround because it will call a repaint
// which the peer may not be ready to do yet.
}
c = target.getForeground();
if (c == null) {
// we should not call setForeGround because it will call a repaint
// which the peer may not be ready to do yet.
}
}
name = " ";
}
return name;
}
private static native int getJvmPID();
// Init WM_PROTOCOLS atom
// Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
// Set WM_TRANSIENT_FOR and group_leader
}
// as owner window may be an embedded window, we must get a toplevel window
// to set as TRANSIENT_FOR hint
if (ownerWindow != 0) {
try {
// Set WM_TRANSIENT_FOR
if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
setToplevelTransientFor(this, ownerPeer, false, true);
// Set group leader
}
finally {
}
}
}
try {
}
} finally {
}
}
// Init warning window(for applets)
// accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip
// and TrayIcon balloon windows without a warning window.
}
}
setSaveUnder(true);
updateShape();
// no need in updateOpaque() as it is no-op
}
public void updateIconImages() {
//read icon images from target
winAttr.iconsInherited = false;
}
continue;
}
try {
} catch (Exception e){
log.finest("XWindowPeer.updateIconImages: Perhaps the image passed into Java is broken. Skipping this icon.");
}
continue;
}
}
}
}
// Fix for CR#6425089
//target.icons is empty or all icon images are broken
//icon is inherited from parent
winAttr.iconsInherited = true;
} else {
//default icon is used
winAttr.iconsInherited = false;
}
}
}
/*
* Sometimes XChangeProperty(_NET_WM_ICON) doesn't work if
* image buffer is too large. This function help us accommodate
* initial list of the icon images to certainly-acceptable.
* It does scale some of these icons to appropriate size
* if it's necessary.
*/
int totalLength = 0;
boolean haveLargeIcon = false;
if (haveLargeIcon) {
continue;
}
int scaledWidth = width;
int scaledHeight = height;
while (scaledWidth > PREFERRED_SIZE_FOR_ICON ||
}
}
totalLength += length;
haveLargeIcon = true;
}
}
}
", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON);
}
return result;
}
/*
* Dumps each icon from the list
*/
}
}
}
for (int i = 0; i < cnt; i++) {
}
}
}
}
}
//This does nothing for XWindowPeer,
//It's overriden in XDecoratedPeer
}
if (defaultIconInfo == null) {
} else {
}
}
return defaultIconInfo;
}
private void updateShape() {
// Shape shape = ((Window)target).getShape();
}
}
private void updateOpacity() {
// float opacity = ((Window)target).getOpacity();
if (opacity < 1.0f) {
}
}
public void updateMinimumSize() {
//This function only saves minimumSize value in XWindowPeer
//Setting WMSizeHints is implemented in XDecoratedPeer
}
}
return ownerPeer;
}
//Fix for 6318144: PIT:Setting Min Size bigger than current size enlarges
//the window but fails to revalidate, Sol-CDE
//This bug is regression for
//5025858: Resizing a decorated frame triggers componentResized event twice.
//Since events are not posted from Component.setBounds we need to send them here.
//Note that this function is overriden in XDecoratedPeer so event
//posting is not changing for decorated peers
try {
}
if (isResized) {
}
if (isMoved) {
}
} finally {
}
}
void updateFocusability() {
try {
}
finally {
}
}
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
public void handleIconify() {
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
public void handleDeiconify() {
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
}
/**
* DEPRECATED: Replaced by getInsets().
*/
return getInsets();
}
boolean isAutoRequestFocus() {
if (XToolkit.isToolkitThread()) {
} else {
}
}
/*
* Retrives real native focused window and converts it into Java peer.
*/
(baseWindow instanceof XFocusProxyWindow) ?
}
/*
* Retrives real native focused window and converts it into Java window.
*/
}
boolean isFocusableWindow() {
{
return cachedFocusableWindow;
} else {
}
}
/* WARNING: don't call client code in this method! */
boolean isFocusedWindowModalBlocker() {
return false;
}
long getFocusTargetWindow() {
return getContentWindow();
}
/**
* Returns whether or not this window peer has native X window
* configured as non-focusable window. It might happen if:
* - Java window is non-focusable
* - Java window is simple Window(not Frame or Dialog)
*/
boolean isNativelyNonFocusableWindow() {
{
return isSimpleWindow() || !cachedFocusableWindow;
} else {
}
}
public void handleWindowFocusIn_Dispatch() {
if (EventQueue.isDispatchThread()) {
}
}
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
/* wrap in Sequenced, then post*/
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
/* wrap in Sequenced, then post*/
}
}
/* --- DisplayChangedListener Stuff --- */
/* Xinerama
* called to check if we've been moved onto a different screen
* Based on checkNewXineramaScreen() in awt_GraphicsEnv.c
*/
return;
}
log.finest("XWindowPeer: Check if we've been moved to a new screen since we're running in Xinerama mode");
}
int largestAmt = 0;
int newScreenNum = 0;
// Completely on this screen - done!
newScreenNum = i;
break;
}
if (intAmt > largestAmt) {
largestAmt = intAmt;
newScreenNum = i;
}
}
}
if (newScreenNum != curScreenNum) {
}
}
}
/**
* Helper method that executes the displayChanged(screen) method on
* the event dispatch thread. This method is used in the Xinerama case
* and after display mode change events.
*/
public void run() {
}
};
}
/**
* From the DisplayChangedListener interface; called from
* X11GraphicsDevice when the display mode has been changed.
*/
public void displayChanged() {
}
/**
* From the DisplayChangedListener interface; top-levels do not need
* to react to this event.
*/
public void paletteChanged() {
}
/*
* Overridden to check if we need to update our GraphicsDevice/Config
* Added for 4934052.
*/
// TODO: We create an XConfigureEvent every time we override
// handleConfigureNotify() - too many!
xe.get_height()));
// Don't call super until we've handled a screen change. Otherwise
// there could be a race condition in which a ComponentListener could
// see the old screen.
super.handleConfigureNotifyEvent(xev);
}
requestXFocus(time, true);
}
final void requestXFocus() {
requestXFocus(0, false);
}
/**
* Requests focus to this top-level. Descendants should override to provide
* implementations based on a class of top-level.
*/
// 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.
}
public final boolean focusAllowedFor() {
if (isNativelyNonFocusableWindow()) {
return false;
}
/*
Window target = (Window)this.target;
if (!target.isVisible() ||
!target.isEnabled() ||
!target.isFocusable())
{
return false;
}
*/
if (isModalBlocked()) {
return false;
}
return true;
}
if (isEventDisabled(xev)) {
return;
}
{
// If this window is non-focusable don't post any java focus event
if (focusAllowedFor()) {
{
}
}
}
else
{
{
// If this window is non-focusable don't post any java focus event
if (!isNativelyNonFocusableWindow()) {
if (oppositeTarget instanceof Window) {
}
// Check if opposite window is non-focusable. In that case we don't want to
// post any event.
return;
}
if (this == oppositeXWindow) {
} else if (oppositeXWindow instanceof XDecoratedPeer) {
if (oppositeTarget instanceof Window
&& oppositeXWindow.isVisible()
{
}
}
}
}
}
}
}
public void toFront() {
if (isOverrideRedirect() && mustControlStackPosition) {
mustControlStackPosition = false;
}
if (isVisible()) {
super.toFront();
if (isFocusableWindow() && isAutoRequestFocus() &&
!isModalBlocked() && !isWithdrawn())
{
}
} else {
setVisible(true);
}
}
public void toBack() {
try {
if(!isOverrideRedirect()) {
}else{
}
}
finally {
}
}
private void lowerOverrideRedirect() {
//
// make new hash of toplevels of all windows from 'windows' hash.
// FIXME: do not call them "toplevel" as it is misleading.
//
}
if( topl > 0 )
}
//
// find in the root's tree:
// (1) my toplevel, (2) lowest java toplevel, (3) desktop
// We must enforce (3), (1), (2) order, upward;
// note that nautilus on the next restacking will do (1),(3),(2).
//
int i = 0;
try {
for(i = 0; i < nchildren; i++) {
iMy = i;
}else if( isDesktopWindow( laux ) ) {
// we need topmost desktop of them all.
iDesktop = i;
}else if(iBottom < 0 &&
iBottom = i;
}
}
}
return; // no action necessary
if( !mustControlStackPosition ) {
mustControlStackPosition = true;
// add root window property listener:
// somebody (eg nautilus desktop) may obscure us
}
} finally {
}
}
/**
Get XID of closest to root window in a given window hierarchy.
FIXME: do not call it "toplevel" as it is misleading.
On error return 0.
*/
private long getToplevelWindow( long w ) {
do {
try {
return 0;
}
} finally {
}
return ret;
}
}
private void updateAlwaysOnTop() {
}
public void updateAlwaysOnTopState() {
}
boolean isLocationByPlatform() {
return locationByPlatform;
}
private void promoteDefaultPosition() {
if (locationByPlatform) {
try {
} finally {
}
}
}
isBeforeFirstMapNotify = true;
if (!winAttr.initialFocus) {
/*
* It's easier and safer to temporary suppress WM_TAKE_FOCUS
* protocol itself than to ignore WM_TAKE_FOCUS client message.
* Because we will have to make the difference between
* the message come after showing and the message come after
* activation. Also, on Metacity, for some reason, we have _two_
*/
suppressWmTakeFocus(true);
}
}
warningWindow.setSecurityWarningVisible(false, false);
}
super.setVisible(vis);
if (!vis && !isWithdrawn()) {
// ICCCM, 4.1.4. Changing Window State:
// "Iconic -> Withdrawn - The client should unmap the window and follow it
// with a synthetic UnmapNotify event as described later in this section."
// The same is true for Normal -> Withdrawn
try {
unmap.set_from_configure(false);
}
finally {
}
}
// method called somewhere in parent does not generate configure-notify
// event for override-redirect.
// Ergo, no reshape and bugs like 5085647 in case setBounds was
// called before setVisible.
if (isOverrideRedirect() && vis) {
}
}
}
final boolean isSimpleWindow() {
}
boolean hasWarningWindow() {
}
// The height of menu bar window
int getMenuBarHeight() {
return 0;
}
// Called when shell changes its size and requires children windows
// to update their sizes appropriately
void updateChildrenSizes() {
}
public void repositionSecurityWarning() {
// the Java window may be swinging while it's being moved.
// This doesn't make the application unusable though looks quite ugly.
// Probobly we need to find some hint to assign to our Security
// Warning window in order to exclude it from the snapping option.
// We are not currently aware of existance of such a property.
if (warningWindow != null) {
// We can't use the coordinates stored in the XBaseWindow since
// they are zeros for decorated frames.
}
}
super.setMouseAbove(above);
}
super.setFullScreenExclusiveModeState(state);
}
public void updateSecurityWarningVisibility() {
if (warningWindow == null) {
return;
}
if (!isVisible()) {
return; // The warning window should already be hidden.
}
boolean show = false;
if (!isFullScreenExclusiveMode()) {
int state = getWMState();
// getWMState() always returns 0 (Withdrawn) for simple windows. Hence
// we ignore the state for such windows.
getTarget())
{
show = true;
}
{
show = true;
}
}
}
}
boolean isOverrideRedirect() {
}
final boolean isOLWMDecorBug() {
winAttr.nativeDecor == false;
}
public void dispose() {
if (isGrabbed()) {
}
}
try {
} finally {
}
if (warningWindow != null) {
}
mustControlStackPosition = false;
super.dispose();
/*
* Fix for 6457980.
* When disposing an owned Window we should implicitly
* return focus to its decorated owner because it won't
* receive WM_TAKE_FOCUS.
*/
if (isSimpleWindow()) {
}
}
}
boolean isResizable() {
return winAttr.isResizable;
}
super.handleVisibilityEvent(xev);
// if (ve.get_state() == XlibWrapper.VisibilityUnobscured) {
// // raiseInputMethodWindow
// }
}
if( mustControlStackPosition &&
// As of now, don't use any generic machinery: just
// do toBack() again.
if(isOverrideRedirect()) {
toBack();
}
}
}
private void removeStartupNotification() {
if (isStartupNotificationRemoved.getAndSet(true)) {
return;
}
}
});
if (desktopStartupId == null) {
return;
}
}
}
final byte[] message;
try {
} catch (UnsupportedEncodingException cannotHappen) {
return;
}
try {
req = new XClientMessageEvent();
int i = 0;
for (; i < msglen; i++) {
}
for (; i < 20; i++) {
}
false,
}
} finally {
}
}
}
// See 6480534.
isUnhiding |= isWMStateNetHidden();
super.handleMapNotifyEvent(xev);
if (!winAttr.initialFocus) {
suppressWmTakeFocus(false); // restore the protocol.
/*
* without WM_TAKE_FOCUS protocol doesn't get moved to the front.
* So, we do it evidently.
*/
try {
} finally {
}
}
if (shouldFocusOnMapNotify()) {
}
isUnhiding = false;
isBeforeFirstMapNotify = false;
synchronized (getStateLock()) {
if (!isMapped) {
isMapped = true;
}
}
}
super.handleUnmapNotifyEvent(xev);
// On Metacity UnmapNotify comes before PropertyNotify (for _NET_WM_STATE_HIDDEN).
// So we also check for the property later in MapNotify. See 6480534.
isUnhiding |= isWMStateNetHidden();
synchronized (getStateLock()) {
if (isMapped) {
isMapped = false;
}
}
}
private boolean shouldFocusOnMapNotify() {
boolean res = false;
if (isBeforeFirstMapNotify) {
} else {
}
isFocusableWindow() && // General focusability
!isModalBlocked(); // Modality
return res;
}
protected boolean isWMStateNetHidden() {
}
protected void requestInitialFocus() {
}
}
}
/**
* Override this methods to get notifications when top-level window state changes. The state is
* meant in terms of ICCCM: WithdrawnState, IconicState, NormalState
*/
// Fix for 6401700, 6412803
// If this window is modal blocked, it is put into the transient_for
// chain using prevTransientFor and nextTransientFor hints. However,
// the real WM_TRANSIENT_FOR hint shouldn't be set for windows in
// different WM states (except for owner-window relationship), so
// if the window changes its state, its real WM_TRANSIENT_FOR hint
// should be updated accordingly.
}
}
boolean isWithdrawn() {
}
if (!winAttr.nativeDecor) {
return false;
}
else {
return !hasBits;
else
return hasBits;
}
}
super.setReparented(newValue);
try {
if (isReparented() && delayedModalBlocking) {
delayedModalBlocking = false;
}
} finally {
}
}
/*
* Returns a Vector of all Java top-level windows,
* sorted by their current Z-order
*/
v.add(rootWindow);
}
} else {
}
try {
// XQueryTree returns window children ordered by z-order
for (int i = 0; i < nchildren; i++) {
// filter out Java non-toplevels
continue;
} else {
}
if (childWindow instanceof XWindowPeer) {
// XQueryTree returns windows sorted by their z-order. However,
// if WM has not handled transient for hint for a child window,
// it may appear in javaToplevels before its owner. Move such
// children after their owners.
int k = 0;
if (toCheckOwnerPeer == np) {
javaToplevels.remove(k);
} else {
k++;
}
}
}
}
}
} finally {
}
}
return javaToplevels;
}
}
{
try {
// State lock should always be after awtLock
synchronized(getStateLock()) {
if (blocked) {
modalBlocker = d;
} else {
delayedModalBlocking = true;
}
} else {
if (d != modalBlocker) {
throw new IllegalStateException("Trying to unblock window blocked by another dialog");
}
modalBlocker = null;
} else {
delayedModalBlocking = false;
}
}
}
} finally {
}
}
/*
* Sets the TRANSIENT_FOR hint to the given top-level window. This
* If window or transientForWindow are embedded frames, the containing
* top-level windows are used.
*
* @param window specifies the top-level window that the hint
* is to be set to
* @param transientForWindow the top-level window
* @param updateChain specifies if next/prevTransientFor fields are
* to be updated
* @param allStates if set to <code>true</code> then TRANSIENT_FOR hint
* is set regardless of the state of window and transientForWindow,
* otherwise it is set only if both are in the same state
*/
boolean updateChain, boolean allStates)
{
return;
}
if (updateChain) {
}
return;
}
return;
}
return;
}
}
}
}
/*
* This method does nothing if this window is not blocked by any modal dialog.
* For modal blocked windows this method looks up for the nearest
* as this one and makes this window transient for it. The same operation is
* performed for nextTransientFor window.
* Values of prevTransientFor and nextTransientFor fields are not changed.
*/
void updateTransientFor() {
int state = getWMState();
p = p.prevTransientFor;
}
if (p != null) {
setToplevelTransientFor(this, p, false, false);
} else {
restoreTransientFor(this);
}
n = n.nextTransientFor;
}
if (n != null) {
setToplevelTransientFor(n, this, false, false);
}
}
/*
* Removes the TRANSIENT_FOR hint from the given top-level window.
* If window or transientForWindow are embedded frames, the containing
* top-level windows are used.
*
* @param window specifies the top-level window that the hint
* is to be removed from
*/
}
}
/*
* When a modal dialog is shown, all its blocked windows are lined up into
* a chain in such a way that each window is a transient_for window for
* the next one. That allows us to keep the modal dialog above all its
* blocked windows (even if there are some another modal dialogs between
* them).
* This method adds this top-level window to the chain of the given modal
* dialog. To keep the current relative z-order, we should use the
* XQueryTree to find the place to insert this window to. As each window
* can be blocked by only one modal dialog (such checks are performed in
* shared code), both this and blockerPeer are on the top of their chains
* (chains may be empty).
* If this window is a modal dialog and has its own chain, these chains are
* merged according to the current z-order (XQueryTree is used again).
* Below are some simple examples (z-order is from left to right, -- is
* modal blocking).
*
* Example 0:
* T (current chain of this, no windows are blocked by this)
* W1---B (current chain of blockerPeer, W2 is blocked by blockerPeer)
* Result is:
* W1-T-B (merged chain, all the windows are blocked by blockerPeer)
*
* Example 1:
* W1-T (current chain of this, W1 is blocked by this)
* W2-B (current chain of blockerPeer, W2 is blocked by blockerPeer)
* Result is:
* W1-T-W2-B (merged chain, all the windows are blocked by blockerPeer)
*
* Example 2:
* W1----T (current chain of this, W1 is blocked by this)
* W2---B (current chain of blockerPeer, W2 is blocked by blockerPeer)
* Result is:
* W1-W2-T-B (merged chain, all the windows are blocked by blockerPeer)
*
* This method should be called under the AWT lock.
*
* @see #removeFromTransientFors
* @see #setModalBlocked
*/
}
{
// blockerPeer chain iterator
}
// this window chain iterator
// each window can be blocked no more than once, so this window
// is on top of its chain
XWindowPeer thisChain = this;
}
// if there are no windows blocked by modalBlocker, simply add this window
// and its chain to blocker's chain
if (blockerChain == blockerPeer) {
setToplevelTransientFor(blockerPeer, this, true, false);
} else {
// Collect all the Java top-levels, if required
if (javaToplevels == null) {
}
// merged chain tail
for (XWindowPeer w : javaToplevels) {
if (w == thisChain) {
if (thisChain == this) {
if (prevMergedChain != null) {
setToplevelTransientFor(this, prevMergedChain, true, false);
}
setToplevelTransientFor(blockerChain, this, true, false);
break;
} else {
}
} else if (w == blockerChain) {
} else {
continue;
}
if (prevMergedChain == null) {
} else {
}
if (blockerChain == blockerPeer) {
setToplevelTransientFor(blockerChain, this, true, false);
break;
}
}
}
}
} else {
}
}
/*
* When a window is modally unblocked, it should be removed from its blocker
* chain, see {@link #addToTransientFor addToTransientFors} method for the
* chain definition.
* The problem is that we cannot simply restore window's original
* TRANSIENT_FOR hint (if any) and link prevTransientFor and
* nextTransientFor together as the whole chain could be created as a merge
* of two other chains in addToTransientFors. In that case, if this window is
* a modal dialog, it would lost all its own chain, if we simply exclude it
* from the chain.
* The correct behaviour of this method should be to split the chain, this
* window is currently in, into two chains. First chain is this window own
* chain (i. e. all the windows blocked by this one, directly or indirectly),
* if any, and the rest windows from the current chain.
*
* Example:
* Original state:
* W1-B1 (window W1 is blocked by B1)
* W2-B2 (window W2 is blocked by B2)
* B3 is shown and blocks B1 and B2:
* W1-W2-B1-B2-B3 (a single chain after B1.addToTransientFors() and B2.addToTransientFors())
* If we then unblock B1, the state should be:
* W1-B1 (window W1 is blocked by B1)
* W2-B2-B3 (window W2 is blocked by B2 and B2 is blocked by B3)
*
* This method should be called under the AWT lock.
*
* @see #addToTransientFors
* @see #setModalBlocked
*/
private void removeFromTransientFors() {
// the head of the chain of this window
XWindowPeer thisChain = this;
// the head of the current chain
// nextTransientFor is always not null as this window is in the chain
// the set of blockers in this chain: if this dialog blocks some other
// modal dialogs, their blocked windows should stay in this dialog's chain
thisChainBlockers.add(this);
// current chain iterator in the order from next to prev
while (chainToSplit != null) {
XWindowPeer blocker = (XWindowPeer) AWTAccessor.getComponentAccessor().getPeer(chainToSplit.modalBlocker);
// add to this dialog's chain
} else {
// leave in the current chain
}
}
}
boolean isModalBlocked() {
return modalBlocker != null;
}
}
return window;
}
return requestWindowFocus();
}
public boolean requestWindowFocus() {
return requestWindowFocus(0, false);
}
// If this is Frame or Dialog we can't assure focus request success - but we still can try
// If this is Window and its owner Frame is active we can be sure request succedded.
if (isWMStateNetHidden()) {
return false;
}
if (activeWindow == ownerWindow) {
return true;
}
return true;
}
return false;
}
// This method is to be overriden in XDecoratedPeer.
}
/**
* Applies the current window type.
*/
private void applyWindowType() {
return;
}
switch (getWindowType())
{
case NORMAL:
break;
case UTILITY:
break;
case POPUP:
break;
}
} else {
}
}
try {
if (visible) {
} else {
}
}
finally {
}
}
// should be synchronized on awtLock
public void addDropTarget() {
try {
if (dropTargetCount == 0) {
if (window != 0) {
}
}
} finally {
}
}
public void removeDropTarget() {
try {
if (dropTargetCount == 0) {
if (window != 0) {
}
}
} finally {
}
}
void addRootPropertyEventDispatcher() {
if( rootPropertyEventDispatcher == null ) {
rootPropertyEventDispatcher = new XEventDispatcher() {
}
}
};
}
}
void removeRootPropertyEventDispatcher() {
if( rootPropertyEventDispatcher != null ) {
}
}
public void updateFocusableWindowState() {
}
if (net_wm_state == null) {
}
return net_wm_state;
}
}
}
mwm_hints = new PropMwmHints();
if (!XWM.XA_MWM_HINTS.getAtomData(getWindow(), mwm_hints.pData, MWMConstants.PROP_MWM_HINTS_ELEMENTS)) {
}
}
return mwm_hints;
}
}
}
protected void updateDropTarget() {
try {
if (dropTargetCount > 0) {
if (window != 0) {
}
}
} finally {
}
}
if (grab) {
pressTarget = this;
grabInput();
} else {
ungrabInput();
}
}
public boolean isGrabbed() {
}
}
if (isGrabbed()) {
// When window is grabbed, all events are dispatched to
// it. Retarget them to the corresponding windows (notice
// that XBaseWindow.dispatchEvent does the opposite
// 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)
return;
}
}
super.handleXCrossingEvent(xev);
}
}
if (isGrabbed()) {
boolean dragging = false;
for (int i = 0; i < buttonsNumber; i++){
// here is the bug in WM: extra buttons doesn't have state!=0 as they should.
if ((i != 4) && (i != 5)){
}
}
// When window is grabbed, all events are dispatched to
// it. Retarget them to the corresponding windows (notice
// that XBaseWindow.dispatchEvent does the opposite
// translation)
// for some reasons if we grab input MotionNotify for drag is reported with target
// to underlying window, not to window on which we have initiated drag
// so we need to retarget them. Here I use simplified logic which retarget all
// such events to source of mouse press (or the grabber). It helps with fix for 6390326.
// So, I do not want to implement complicated logic for better retargeting.
}
return;
}
}
// note that we need to pass dragging events to the grabber (6390326)
// see comment above for more inforamtion.
// Outside of Java
return;
}
}
super.handleMotionNotify(xev);
}
// we use it to retarget mouse drag and mouse release during grab.
/*
* Ignore the buttons above 20 due to the bit limit for
* InputEvent.BUTTON_DOWN_MASK.
* One more bit is reserved for FIRST_HIGH_BIT.
*/
return;
}
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
// it. Retarget them to the corresponding windows (notice
// that XBaseWindow.dispatchEvent does the opposite
// translation)
try {
{
// need to keep it to retarget mouse release
&& pressTarget != target)
{
// during grab we do receive mouse release on different component (not on the source
// of mouse press). So we need to retarget it.
// see 6390326 for more information.
pressTarget = this;
}
return;
}
} finally {
// Target is either us or our content window -
// check that event is inside. 'Us' in case of
// shell will mean that this will also filter out press on title
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
return;
}
}
// First, get the toplevel
if (w != null) {
}
}
// toplevel == null - outside of
// hierarchy, toplevel is Dialog - should
// send ungrab (but shouldn't for Window)
}
} else {
// toplevel is null - outside of hierarchy
return;
}
} else {
// target doesn't map to XAWT window - outside of hierarchy
return;
}
}
}
super.handleButtonPressRelease(xev);
}
// We assume we print the whole frame,
// so we expect no clip was set previously
}
super.print(g);
}
final long maxOpacity = 0xffffffffl;
if (iOpacity < 0) {
iOpacity = 0;
}
if (iOpacity > maxOpacity) {
}
if (iOpacity == maxOpacity) {
} else {
}
}
// no-op
}
public void updateWindow() {
// no-op
}
}