< prev index next >

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

Print this page




 720             long parent = XlibUtil.getParentWindow(window);
 721             Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
 722             if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
 723                 if (correctWM != null) {
 724                     insLog.finer("Configure notify - insets : " + correctWM);
 725                 } else {
 726                     insLog.finer("Configure notify - insets are still not available");
 727                 }
 728             }
 729             if (correctWM != null) {
 730                 handleCorrectInsets(correctWM);
 731             } else {
 732                 //Only one attempt to correct insets is made (to lower risk)
 733                 //if insets are still not available we simply set the flag
 734                 insets_corrected = true;
 735             }
 736         }
 737 
 738         updateChildrenSizes();
 739 
 740         // Bounds of the window
 741         Rectangle targetBounds = AWTAccessor.getComponentAccessor().getBounds(target);
 742 
 743         Point newLocation = getNewLocation(xe, currentInsets.left, currentInsets.top);
 744 
 745         WindowDimensions newDimensions =
 746                 new WindowDimensions(newLocation,
 747                 new Dimension(xe.get_width(), xe.get_height()),
 748                 copy(currentInsets),
 749                 true);
 750 
 751         if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
 752             insLog.finer("Insets are {0}, new dimensions {1}",
 753                      currentInsets, newDimensions);
 754         }
 755 
 756         checkIfOnNewScreen(newDimensions.getBounds());
 757 
 758         Point oldLocation = getLocation();
 759         dimensions = newDimensions;
 760         if (!newLocation.equals(oldLocation)) {
 761             handleMoved(newDimensions);
 762         }
 763         reconfigureContentWindow(newDimensions);
 764         updateChildrenSizes();
 765 
 766         repositionSecurityWarning();
 767     }
 768 
 769     private void checkShellRectSize(Rectangle shellRect) {


 776         if (wm == XWM.MOTIF_WM || wm == XWM.CDE_WM) {
 777             if (shellRect.x == 0 && shellRect.y == 0) {
 778                 shellRect.x = shellRect.y = 1;
 779             }
 780         }
 781     }
 782 
 783     private void checkShellRect(Rectangle shellRect) {
 784         checkShellRectSize(shellRect);
 785         checkShellRectPos(shellRect);
 786     }
 787 
 788     public void setShellBounds(Rectangle rec) {
 789         if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
 790             insLog.fine("Setting shell bounds on " + this + " to " + rec);
 791         }
 792         XToolkit.awtLock();
 793         try {
 794             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
 795             XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), getShell(),
 796                             rec.x, rec.y, rec.width, rec.height);

 797         }
 798         finally {
 799             XToolkit.awtUnlock();
 800         }
 801     }
 802     public void setShellSize(Rectangle rec) {
 803         if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
 804             insLog.fine("Setting shell size on " + this + " to " + rec);
 805         }
 806         XToolkit.awtLock();
 807         try {
 808             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
 809             XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(), rec.width, rec.height);

 810         }
 811         finally {
 812             XToolkit.awtUnlock();
 813         }
 814     }
 815     public void setShellPosition(Rectangle rec) {
 816         if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
 817             insLog.fine("Setting shell position on " + this + " to " + rec);
 818         }
 819         XToolkit.awtLock();
 820         try {
 821             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
 822             XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(), rec.x, rec.y);

 823         }
 824         finally {
 825             XToolkit.awtUnlock();
 826         }
 827     }
 828 
 829     void initResizability() {
 830         setResizable(winAttr.initialResizability);
 831     }
 832     public void setResizable(boolean resizable) {
 833         int fs = winAttr.functions;
 834         if (!isResizable() && resizable) {
 835             currentInsets = new Insets(0, 0, 0, 0);
 836             resetWMSetInsets();
 837             if (!isEmbedded()) {
 838                 setReparented(false);
 839             }
 840             winAttr.isResizable = resizable;
 841             if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
 842                 fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);




 720             long parent = XlibUtil.getParentWindow(window);
 721             Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
 722             if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
 723                 if (correctWM != null) {
 724                     insLog.finer("Configure notify - insets : " + correctWM);
 725                 } else {
 726                     insLog.finer("Configure notify - insets are still not available");
 727                 }
 728             }
 729             if (correctWM != null) {
 730                 handleCorrectInsets(correctWM);
 731             } else {
 732                 //Only one attempt to correct insets is made (to lower risk)
 733                 //if insets are still not available we simply set the flag
 734                 insets_corrected = true;
 735             }
 736         }
 737 
 738         updateChildrenSizes();
 739 



 740         Point newLocation = getNewLocation(xe, currentInsets.left, currentInsets.top);

 741         WindowDimensions newDimensions =
 742                 new WindowDimensions(newLocation,
 743                                      new Dimension(scaleDown(xe.get_width()),
 744                                                    scaleDown(xe.get_height())),
 745                                      copy(currentInsets), true);
 746 
 747         if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
 748             insLog.finer("Insets are {0}, new dimensions {1}",
 749                      currentInsets, newDimensions);
 750         }
 751 
 752         checkIfOnNewScreen(newDimensions.getBounds());
 753 
 754         Point oldLocation = getLocation();
 755         dimensions = newDimensions;
 756         if (!newLocation.equals(oldLocation)) {
 757             handleMoved(newDimensions);
 758         }
 759         reconfigureContentWindow(newDimensions);
 760         updateChildrenSizes();
 761 
 762         repositionSecurityWarning();
 763     }
 764 
 765     private void checkShellRectSize(Rectangle shellRect) {


 772         if (wm == XWM.MOTIF_WM || wm == XWM.CDE_WM) {
 773             if (shellRect.x == 0 && shellRect.y == 0) {
 774                 shellRect.x = shellRect.y = 1;
 775             }
 776         }
 777     }
 778 
 779     private void checkShellRect(Rectangle shellRect) {
 780         checkShellRectSize(shellRect);
 781         checkShellRectPos(shellRect);
 782     }
 783 
 784     public void setShellBounds(Rectangle rec) {
 785         if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
 786             insLog.fine("Setting shell bounds on " + this + " to " + rec);
 787         }
 788         XToolkit.awtLock();
 789         try {
 790             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
 791             XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), getShell(),
 792                                           scaleUp(rec.x), scaleUp(rec.y),
 793                                           scaleUp(rec.width), scaleUp(rec.height));
 794         }
 795         finally {
 796             XToolkit.awtUnlock();
 797         }
 798     }
 799     public void setShellSize(Rectangle rec) {
 800         if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
 801             insLog.fine("Setting shell size on " + this + " to " + rec);
 802         }
 803         XToolkit.awtLock();
 804         try {
 805             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
 806             XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(),
 807                                       scaleUp(rec.width), scaleUp(rec.height));
 808         }
 809         finally {
 810             XToolkit.awtUnlock();
 811         }
 812     }
 813     public void setShellPosition(Rectangle rec) {
 814         if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
 815             insLog.fine("Setting shell position on " + this + " to " + rec);
 816         }
 817         XToolkit.awtLock();
 818         try {
 819             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
 820             XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(),
 821                                     scaleUp(rec.x), scaleUp(rec.y));
 822         }
 823         finally {
 824             XToolkit.awtUnlock();
 825         }
 826     }
 827 
 828     void initResizability() {
 829         setResizable(winAttr.initialResizability);
 830     }
 831     public void setResizable(boolean resizable) {
 832         int fs = winAttr.functions;
 833         if (!isResizable() && resizable) {
 834             currentInsets = new Insets(0, 0, 0, 0);
 835             resetWMSetInsets();
 836             if (!isEmbedded()) {
 837                 setReparented(false);
 838             }
 839             winAttr.isResizable = resizable;
 840             if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
 841                 fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);


< prev index next >