src/solaris/classes/sun/awt/X11/XWindow.java

Print this page

        

*** 279,294 **** protected String[] getWMClass() { return new String[] {XToolkit.getCorrectXIDString(getClass().getName()), XToolkit.getAWTAppClassName()}; } ! void setReparented(boolean newValue) { ! reparented = newValue; } ! boolean isReparented() { ! return reparented; } static long getParentWindowID(Component target) { ComponentPeer peer = target.getParent().getPeer(); --- 279,366 ---- protected String[] getWMClass() { return new String[] {XToolkit.getCorrectXIDString(getClass().getName()), XToolkit.getAWTAppClassName()}; } ! /** ! * Current native parent of this window. ! * ! * Synchronization: state lock. ! */ ! private long nativeParent = XConstants.None; ! ! /** ! * Get the current native parent window of this window as reported via ! * the ReparentNotify. ! */ ! public final long getNativeParent() { ! synchronized (getStateLock()) { ! return nativeParent; ! } ! } ! ! /** ! * Sets the current native parent of the window. ! * Primarily intended to be called from the handleReparentNotifyEvent(). ! */ ! public void setNativeParent(long parent) { ! synchronized (getStateLock()) { ! nativeParent = parent; ! } ! } ! ! @Override ! public void handleReparentNotifyEvent(XEvent xev) { ! super.handleReparentNotifyEvent(xev); ! ! XReparentEvent xe = xev.get_xreparent(); ! ! if (xe.get_window() != getWindow()) { ! return; ! } ! ! setNativeParent(xe.get_parent()); ! } ! ! /** ! * Returns the root window of the current window. ! */ ! public final long getRootWindow() { ! if (getWindow() == XConstants.None) { ! return XConstants.None; ! } ! XToolkit.awtLock(); ! try { ! XlibUtil.getWindowGeometry(getWindow(), XlibWrapper.larg1); ! return Native.getWindow(XlibWrapper.larg1); ! } finally { ! XToolkit.awtUnlock(); ! } } ! /** ! * Indicates whether the window is currently parented or not. ! */ ! public final boolean isParented() { ! long nativeParent = getNativeParent(); ! return nativeParent != XConstants.None && ! nativeParent != getRootWindow(); ! } ! ! /** ! * Indicates if this window has not yet been parented by the window ! * manager. ! * ! * If the window is not expected to be parented at all (like if the WM is ! * non-reparenting, or this is an OverrideRedirect window), this method ! * returns false. ! */ ! public boolean mayBeReparented() { ! return ! XWM.isRunning() && ! !XWM.isNonReparentingWM() && ! !isParented(); } static long getParentWindowID(Component target) { ComponentPeer peer = target.getParent().getPeer();
*** 992,1028 **** } public void doLayout(int x, int y, int width, int height) {} public void handleConfigureNotifyEvent(XEvent xev) { ! Rectangle oldBounds = getBounds(); super.handleConfigureNotifyEvent(xev); insLog.log(Level.FINER, "Configure, {0}, event disabled: {1}", ! new Object[] {xev.get_xconfigure(), isEventDisabled(xev)}); if (isEventDisabled(xev)) { return; } ! // if ( Check if it's a resize, a move, or a stacking order change ) ! // { Rectangle bounds = getBounds(); if (!bounds.getSize().equals(oldBounds.getSize())) { postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED)); } if (!bounds.getLocation().equals(oldBounds.getLocation())) { postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED)); } - // } } public void handleMapNotifyEvent(XEvent xev) { super.handleMapNotifyEvent(xev); log.log(Level.FINE, "Mapped {0}", new Object[] {this}); if (isEventDisabled(xev)) { return; } ComponentEvent ce; ce = new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_SHOWN); postEventToEventQueue(ce); } --- 1064,1108 ---- } public void doLayout(int x, int y, int width, int height) {} public void handleConfigureNotifyEvent(XEvent xev) { ! XConfigureEvent xe = xev.get_xconfigure(); + if (xe.get_window() != getWindow()) { + return; + } + + Rectangle oldBounds = getBounds(); super.handleConfigureNotifyEvent(xev); insLog.log(Level.FINER, "Configure, {0}, event disabled: {1}", ! new Object[] {xe, isEventDisabled(xev)}); if (isEventDisabled(xev)) { return; } ! Rectangle bounds = getBounds(); if (!bounds.getSize().equals(oldBounds.getSize())) { postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED)); } if (!bounds.getLocation().equals(oldBounds.getLocation())) { postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED)); } } public void handleMapNotifyEvent(XEvent xev) { super.handleMapNotifyEvent(xev); log.log(Level.FINE, "Mapped {0}", new Object[] {this}); if (isEventDisabled(xev)) { return; } + + if (xev.get_xany().get_window() != getWindow()) { + return; + } + ComponentEvent ce; ce = new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_SHOWN); postEventToEventQueue(ce); }
*** 1030,1039 **** --- 1110,1123 ---- public void handleUnmapNotifyEvent(XEvent xev) { super.handleUnmapNotifyEvent(xev); if (isEventDisabled(xev)) { return; } + if (xev.get_xany().get_window() != getWindow()) { + return; + } + ComponentEvent ce; ce = new ComponentEvent(target, ComponentEvent.COMPONENT_HIDDEN); postEventToEventQueue(ce); }
*** 1400,1410 **** XToolkit.awtLock(); try { Object wpeer = XToolkit.targetToPeer(comp); if (wpeer == null || !(wpeer instanceof XDecoratedPeer) ! || ((XDecoratedPeer)wpeer).configure_seen) { return toGlobal(0, 0); } // wpeer is an XDecoratedPeer not yet fully adopted by WM --- 1484,1494 ---- XToolkit.awtLock(); try { Object wpeer = XToolkit.targetToPeer(comp); if (wpeer == null || !(wpeer instanceof XDecoratedPeer) ! || !((XDecoratedPeer)wpeer).areBoundsAdjusting()) { return toGlobal(0, 0); } // wpeer is an XDecoratedPeer not yet fully adopted by WM