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

Print this page




 215         super.postInit(params);
 216 
 217         // Init WM_PROTOCOLS atom
 218         initWMProtocols();
 219 
 220         // Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
 221         XAtom.get("WM_CLIENT_MACHINE").setProperty(getWindow(), getLocalHostname());
 222         XAtom.get("_NET_WM_PID").setCard32Property(getWindow(), getJvmPID());
 223 
 224         // Set WM_TRANSIENT_FOR and group_leader
 225         Window t_window = (Window)target;
 226         Window owner = t_window.getOwner();
 227         if (owner != null) {
 228             ownerPeer = (XWindowPeer)owner.getPeer();
 229             if (focusLog.isLoggable(PlatformLogger.FINER)) {
 230                 focusLog.fine("Owner is " + owner);
 231                 focusLog.fine("Owner peer is " + ownerPeer);
 232                 focusLog.fine("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
 233                 focusLog.fine("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
 234             }








 235             // as owner window may be an embedded window, we must get a toplevel window
 236             // to set as TRANSIENT_FOR hint
 237             long ownerWindow = ownerPeer.getWindow();
 238             if (ownerWindow != 0) {
 239                 XToolkit.awtLock();
 240                 try {
 241                     // Set WM_TRANSIENT_FOR
 242                     if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
 243                                                                        + " for " + Long.toHexString(ownerWindow));
 244                     setToplevelTransientFor(this, ownerPeer, false, true);
 245 
 246                     // Set group leader
 247                     XWMHints hints = getWMHints();
 248                     hints.set_flags(hints.get_flags() | (int)XUtilConstants.WindowGroupHint);
 249                     hints.set_window_group(ownerWindow);
 250                     XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
 251                 }
 252                 finally {
 253                     XToolkit.awtUnlock();
 254                 }


 462     //Fix for 6318144: PIT:Setting Min Size bigger than current size enlarges
 463     //the window but fails to revalidate, Sol-CDE
 464     //This bug is regression for
 465     //5025858: Resizing a decorated frame triggers componentResized event twice.
 466     //Since events are not posted from Component.setBounds we need to send them here.
 467     //Note that this function is overriden in XDecoratedPeer so event
 468     //posting is not changing for decorated peers
 469     public void setBounds(int x, int y, int width, int height, int op) {
 470         XToolkit.awtLock();
 471         try {
 472             Rectangle oldBounds = getBounds();
 473 
 474             super.setBounds(x, y, width, height, op);
 475 
 476             Rectangle bounds = getBounds();
 477 
 478             XSizeHints hints = getHints();
 479             setSizeHints(hints.get_flags() | XUtilConstants.PPosition | XUtilConstants.PSize,
 480                              bounds.x, bounds.y, bounds.width, bounds.height);
 481             XWM.setMotifDecor(this, false, 0, 0);
 482 
 483             XNETProtocol protocol = XWM.getWM().getNETProtocol();
 484             if (protocol != null && protocol.active()) {
 485                 XAtomList net_wm_state = getNETWMState();
 486                 net_wm_state.add(protocol.XA_NET_WM_STATE_SKIP_TASKBAR);
 487                 setNETWMState(net_wm_state);
 488             }
 489 
 490 
 491             boolean isResized = !bounds.getSize().equals(oldBounds.getSize());
 492             boolean isMoved = !bounds.getLocation().equals(oldBounds.getLocation());
 493             if (isMoved || isResized) {
 494                 repositionSecurityWarning();
 495             }
 496             if (isResized) {
 497                 postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED));
 498             }
 499             if (isMoved) {
 500                 postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED));
 501             }
 502         } finally {
 503             XToolkit.awtUnlock();
 504         }
 505     }
 506 
 507     void updateFocusability() {
 508         updateFocusableWindowState();
 509         XToolkit.awtLock();




 215         super.postInit(params);
 216 
 217         // Init WM_PROTOCOLS atom
 218         initWMProtocols();
 219 
 220         // Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
 221         XAtom.get("WM_CLIENT_MACHINE").setProperty(getWindow(), getLocalHostname());
 222         XAtom.get("_NET_WM_PID").setCard32Property(getWindow(), getJvmPID());
 223 
 224         // Set WM_TRANSIENT_FOR and group_leader
 225         Window t_window = (Window)target;
 226         Window owner = t_window.getOwner();
 227         if (owner != null) {
 228             ownerPeer = (XWindowPeer)owner.getPeer();
 229             if (focusLog.isLoggable(PlatformLogger.FINER)) {
 230                 focusLog.fine("Owner is " + owner);
 231                 focusLog.fine("Owner peer is " + ownerPeer);
 232                 focusLog.fine("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
 233                 focusLog.fine("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
 234             }
 235 
 236             XNETProtocol protocol = XWM.getWM().getNETProtocol();
 237             if (protocol != null && protocol.active()) {
 238                 XAtomList net_wm_state = getNETWMState();
 239                 net_wm_state.add(protocol.XA_NET_WM_STATE_SKIP_TASKBAR);
 240                 setNETWMState(net_wm_state);
 241             }
 242 
 243             // as owner window may be an embedded window, we must get a toplevel window
 244             // to set as TRANSIENT_FOR hint
 245             long ownerWindow = ownerPeer.getWindow();
 246             if (ownerWindow != 0) {
 247                 XToolkit.awtLock();
 248                 try {
 249                     // Set WM_TRANSIENT_FOR
 250                     if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
 251                                                                        + " for " + Long.toHexString(ownerWindow));
 252                     setToplevelTransientFor(this, ownerPeer, false, true);
 253 
 254                     // Set group leader
 255                     XWMHints hints = getWMHints();
 256                     hints.set_flags(hints.get_flags() | (int)XUtilConstants.WindowGroupHint);
 257                     hints.set_window_group(ownerWindow);
 258                     XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
 259                 }
 260                 finally {
 261                     XToolkit.awtUnlock();
 262                 }


 470     //Fix for 6318144: PIT:Setting Min Size bigger than current size enlarges
 471     //the window but fails to revalidate, Sol-CDE
 472     //This bug is regression for
 473     //5025858: Resizing a decorated frame triggers componentResized event twice.
 474     //Since events are not posted from Component.setBounds we need to send them here.
 475     //Note that this function is overriden in XDecoratedPeer so event
 476     //posting is not changing for decorated peers
 477     public void setBounds(int x, int y, int width, int height, int op) {
 478         XToolkit.awtLock();
 479         try {
 480             Rectangle oldBounds = getBounds();
 481 
 482             super.setBounds(x, y, width, height, op);
 483 
 484             Rectangle bounds = getBounds();
 485 
 486             XSizeHints hints = getHints();
 487             setSizeHints(hints.get_flags() | XUtilConstants.PPosition | XUtilConstants.PSize,
 488                              bounds.x, bounds.y, bounds.width, bounds.height);
 489             XWM.setMotifDecor(this, false, 0, 0);








 490 
 491             boolean isResized = !bounds.getSize().equals(oldBounds.getSize());
 492             boolean isMoved = !bounds.getLocation().equals(oldBounds.getLocation());
 493             if (isMoved || isResized) {
 494                 repositionSecurityWarning();
 495             }
 496             if (isResized) {
 497                 postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED));
 498             }
 499             if (isMoved) {
 500                 postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED));
 501             }
 502         } finally {
 503             XToolkit.awtUnlock();
 504         }
 505     }
 506 
 507     void updateFocusability() {
 508         updateFocusableWindowState();
 509         XToolkit.awtLock();