src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java

Print this page

        

*** 44,53 **** --- 44,54 ---- import java.util.Set; import java.util.Vector; import java.util.concurrent.atomic.AtomicBoolean; + import sun.awt.AWTAccessor.ComponentAccessor; import sun.util.logging.PlatformLogger; import sun.awt.AWTAccessor; import sun.awt.DisplayChangedListener; import sun.awt.SunToolkit;
*** 223,233 **** // 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())); --- 224,234 ---- // Set WM_TRANSIENT_FOR and group_leader Window t_window = (Window)target; Window owner = t_window.getOwner(); if (owner != null) { ! ownerPeer = AWTAccessor.getComponentAccessor().getPeer(owner); 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()));
*** 399,417 **** iconLog.finest(" {0}", i.next()); } } } - @SuppressWarnings("deprecation") public void recursivelySetIcon(java.util.List<IconInfo> icons) { dumpIcons(winAttr.icons); setIconHints(icons); Window target = (Window)this.target; Window[] children = target.getOwnedWindows(); int cnt = children.length; for (int i = 0; i < cnt; i++) { ! ComponentPeer childPeer = children[i].getPeer(); if (childPeer != null && childPeer instanceof XWindowPeer) { if (((XWindowPeer)childPeer).winAttr.iconsInherited) { ((XWindowPeer)childPeer).winAttr.icons = icons; ((XWindowPeer)childPeer).recursivelySetIcon(icons); } --- 400,418 ---- iconLog.finest(" {0}", i.next()); } } } public void recursivelySetIcon(java.util.List<IconInfo> icons) { dumpIcons(winAttr.icons); setIconHints(icons); Window target = (Window)this.target; Window[] children = target.getOwnedWindows(); int cnt = children.length; + final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); for (int i = 0; i < cnt; i++) { ! final ComponentPeer childPeer = acc.getPeer(children[i]); if (childPeer != null && childPeer instanceof XWindowPeer) { if (((XWindowPeer)childPeer).winAttr.iconsInherited) { ((XWindowPeer)childPeer).winAttr.icons = icons; ((XWindowPeer)childPeer).recursivelySetIcon(icons); }
*** 1159,1169 **** // 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. ! AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); int x = compAccessor.getX(target); int y = compAccessor.getY(target); int width = compAccessor.getWidth(target); int height = compAccessor.getHeight(target); warningWindow.reposition(x, y, width, height); --- 1160,1170 ---- // 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. ! ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); int x = compAccessor.getX(target); int y = compAccessor.getY(target); int width = compAccessor.getWidth(target); int height = compAccessor.getHeight(target); warningWindow.reposition(x, y, width, height);
*** 1484,1494 **** void setReparented(boolean newValue) { super.setReparented(newValue); XToolkit.awtLock(); try { if (isReparented() && delayedModalBlocking) { ! addToTransientFors((XDialogPeer) AWTAccessor.getComponentAccessor().getPeer(modalBlocker)); delayedModalBlocking = false; } } finally { XToolkit.awtUnlock(); } --- 1485,1495 ---- void setReparented(boolean newValue) { super.setReparented(newValue); XToolkit.awtLock(); try { if (isReparented() && delayedModalBlocking) { ! addToTransientFors(AWTAccessor.getComponentAccessor().getPeer(modalBlocker)); delayedModalBlocking = false; } } finally { XToolkit.awtUnlock(); }
*** 1568,1578 **** { XToolkit.awtLock(); 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; --- 1569,1579 ---- { XToolkit.awtLock(); try { // State lock should always be after awtLock synchronized(getStateLock()) { ! XDialogPeer blockerPeer = AWTAccessor.getComponentAccessor().getPeer(d); if (blocked) { if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("{0} is blocked by {1}", this, blockerPeer); } modalBlocker = d;
*** 1850,1860 **** Set<XWindowPeer> thisChainBlockers = new HashSet<XWindowPeer>(); thisChainBlockers.add(this); // current chain iterator in the order from next to prev XWindowPeer chainToSplit = prevTransientFor; while (chainToSplit != null) { ! XWindowPeer blocker = (XWindowPeer) AWTAccessor.getComponentAccessor().getPeer(chainToSplit.modalBlocker); if (thisChainBlockers.contains(blocker)) { // add to this dialog's chain setToplevelTransientFor(thisChain, chainToSplit, true, false); thisChain = chainToSplit; thisChainBlockers.add(chainToSplit); --- 1851,1861 ---- Set<XWindowPeer> thisChainBlockers = new HashSet<XWindowPeer>(); thisChainBlockers.add(this); // current chain iterator in the order from next to prev XWindowPeer chainToSplit = prevTransientFor; while (chainToSplit != null) { ! XWindowPeer blocker = AWTAccessor.getComponentAccessor().getPeer(chainToSplit.modalBlocker); if (thisChainBlockers.contains(blocker)) { // add to this dialog's chain setToplevelTransientFor(thisChain, chainToSplit, true, false); thisChain = chainToSplit; thisChainBlockers.add(chainToSplit);
*** 1911,1921 **** handleWindowFocusInSync(-1); return true; } focusLog.fine("Parent window is not active"); ! XDecoratedPeer wpeer = (XDecoratedPeer)AWTAccessor.getComponentAccessor().getPeer(ownerWindow); if (wpeer != null && wpeer.requestWindowFocus(this, time, timeProvided)) { focusLog.fine("Parent window accepted focus request - generating focus for this window"); return true; } focusLog.fine("Denied - parent window is not active and didn't accept focus request"); --- 1912,1922 ---- handleWindowFocusInSync(-1); return true; } focusLog.fine("Parent window is not active"); ! XDecoratedPeer wpeer = AWTAccessor.getComponentAccessor().getPeer(ownerWindow); if (wpeer != null && wpeer.requestWindowFocus(this, time, timeProvided)) { focusLog.fine("Parent window accepted focus request - generating focus for this window"); return true; } focusLog.fine("Denied - parent window is not active and didn't accept focus request");
*** 2257,2267 **** if (toplevel != null) { Window w = (Window)toplevel.target; while (w != null && toplevel != this && !(toplevel instanceof XDialogPeer)) { w = (Window) AWTAccessor.getComponentAccessor().getParent(w); if (w != null) { ! toplevel = (XWindowPeer) AWTAccessor.getComponentAccessor().getPeer(w); } } if (w == null || (w != this.target && w instanceof Dialog)) { // toplevel == null - outside of // hierarchy, toplevel is Dialog - should --- 2258,2268 ---- if (toplevel != null) { Window w = (Window)toplevel.target; while (w != null && toplevel != this && !(toplevel instanceof XDialogPeer)) { w = (Window) AWTAccessor.getComponentAccessor().getParent(w); if (w != null) { ! toplevel = AWTAccessor.getComponentAccessor().getPeer(w); } } if (w == null || (w != this.target && w instanceof Dialog)) { // toplevel == null - outside of // hierarchy, toplevel is Dialog - should