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

Print this page




 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                 }
 255             }
 256         }
 257 









 258          // Init warning window(for applets)
 259         if (((Window)target).getWarningString() != null) {
 260             // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip
 261             // and TrayIcon balloon windows without a warning window.
 262             if (!AWTAccessor.getWindowAccessor().isTrayIconWindow((Window)target)) {
 263                 warningWindow = new XWarningWindow((Window)target, getWindow(), this);
 264             }
 265         }
 266 
 267         setSaveUnder(true);
 268 
 269         updateIconImages();
 270 
 271         updateShape();
 272         updateOpacity();
 273         // no need in updateOpaque() as it is no-op
 274     }
 275 
 276     public void updateIconImages() {
 277         Window target = (Window)this.target;


 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();




 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                 }
 255             }
 256         }
 257 
 258         if (owner != null || isSimpleWindow()) {
 259             XNETProtocol protocol = XWM.getWM().getNETProtocol();
 260             if (protocol != null && protocol.active()) {
 261                 XAtomList net_wm_state = getNETWMState();
 262                 net_wm_state.add(protocol.XA_NET_WM_STATE_SKIP_TASKBAR);
 263                 setNETWMState(net_wm_state);
 264             }
 265         }
 266 
 267          // Init warning window(for applets)
 268         if (((Window)target).getWarningString() != null) {
 269             // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip
 270             // and TrayIcon balloon windows without a warning window.
 271             if (!AWTAccessor.getWindowAccessor().isTrayIconWindow((Window)target)) {
 272                 warningWindow = new XWarningWindow((Window)target, getWindow(), this);
 273             }
 274         }
 275 
 276         setSaveUnder(true);
 277 
 278         updateIconImages();
 279 
 280         updateShape();
 281         updateOpacity();
 282         // no need in updateOpaque() as it is no-op
 283     }
 284 
 285     public void updateIconImages() {
 286         Window target = (Window)this.target;


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








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