825 826 private void checkShellRectPos(Rectangle shellRect) { 827 int wm = XWM.getWMID(); 828 if (wm == XWM.MOTIF_WM || wm == XWM.CDE_WM) { 829 if (shellRect.x == 0 && shellRect.y == 0) { 830 shellRect.x = shellRect.y = 1; 831 } 832 } 833 } 834 835 private void checkShellRect(Rectangle shellRect) { 836 checkShellRectSize(shellRect); 837 checkShellRectPos(shellRect); 838 } 839 840 public void setShellBounds(Rectangle rec) { 841 if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell bounds on " + 842 this + " to " + rec); 843 XToolkit.awtLock(); 844 try { 845 updateSizeHints(rec.x, rec.y, rec.width, rec.height); 846 XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(), rec.width, rec.height); 847 XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(), rec.x, rec.y); 848 } 849 finally { 850 XToolkit.awtUnlock(); 851 } 852 } 853 public void setShellSize(Rectangle rec) { 854 if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell size on " + 855 this + " to " + rec); 856 XToolkit.awtLock(); 857 try { 858 updateSizeHints(rec.x, rec.y, rec.width, rec.height); 859 XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(), rec.width, rec.height); 860 } 861 finally { 862 XToolkit.awtUnlock(); 863 } 864 } 865 public void setShellPosition(Rectangle rec) { 866 if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell position on " + 867 this + " to " + rec); 868 XToolkit.awtLock(); 869 try { 870 updateSizeHints(rec.x, rec.y, rec.width, rec.height); 871 XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(), rec.x, rec.y); 872 } 873 finally { 874 XToolkit.awtUnlock(); 875 } 876 } 877 878 void initResizability() { 879 setResizable(winAttr.initialResizability); 880 } 881 public void setResizable(boolean resizable) { 882 int fs = winAttr.functions; 883 if (!isResizable() && resizable) { 884 insets = currentInsets = new Insets(0, 0, 0, 0); 885 resetWMSetInsets(); 886 if (!isEmbedded()) { 887 setReparented(false); 888 } 889 winAttr.isResizable = resizable; 890 if ((fs & MWM_FUNC_ALL) != 0) { | 825 826 private void checkShellRectPos(Rectangle shellRect) { 827 int wm = XWM.getWMID(); 828 if (wm == XWM.MOTIF_WM || wm == XWM.CDE_WM) { 829 if (shellRect.x == 0 && shellRect.y == 0) { 830 shellRect.x = shellRect.y = 1; 831 } 832 } 833 } 834 835 private void checkShellRect(Rectangle shellRect) { 836 checkShellRectSize(shellRect); 837 checkShellRectPos(shellRect); 838 } 839 840 public void setShellBounds(Rectangle rec) { 841 if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell bounds on " + 842 this + " to " + rec); 843 XToolkit.awtLock(); 844 try { 845 /* X does not allow setting heights or widths to 0: this will cause a BadValue 846 * error. Lets set them to something close enough */ 847 int width = rec.width; 848 if (width <= 0) 849 width = 1; 850 int height = rec.height; 851 if (height <= 0) 852 height = 1; 853 updateSizeHints(rec.x, rec.y, width, height); 854 XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(), width, height); 855 XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(), rec.x, rec.y); 856 } 857 finally { 858 XToolkit.awtUnlock(); 859 } 860 } 861 public void setShellSize(Rectangle rec) { 862 if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell size on " + 863 this + " to " + rec); 864 XToolkit.awtLock(); 865 try { 866 /* X does not allow setting heights or widths to 0: this will cause a BadValue 867 * error. Lets set them to something close enough */ 868 int width = rec.width; 869 if (width <= 0) 870 width = 1; 871 int height = rec.height; 872 if (height <= 0) 873 height = 1; 874 updateSizeHints(rec.x, rec.y, width, height); 875 XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(), width, height); 876 } 877 finally { 878 XToolkit.awtUnlock(); 879 } 880 } 881 public void setShellPosition(Rectangle rec) { 882 if (insLog.isLoggable(Level.FINE)) insLog.fine("Setting shell position on " + 883 this + " to " + rec); 884 XToolkit.awtLock(); 885 try { 886 /* X does not allow setting heights or widths to 0: this will cause a BadValue 887 * error. Lets set them to something close enough */ 888 int width = rec.width; 889 if (width <= 0) 890 width = 1; 891 int height = rec.height; 892 if (height <= 0) 893 height = 1; 894 updateSizeHints(rec.x, rec.y, width, height); 895 XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(), rec.x, rec.y); 896 } 897 finally { 898 XToolkit.awtUnlock(); 899 } 900 } 901 902 void initResizability() { 903 setResizable(winAttr.initialResizability); 904 } 905 public void setResizable(boolean resizable) { 906 int fs = winAttr.functions; 907 if (!isResizable() && resizable) { 908 insets = currentInsets = new Insets(0, 0, 0, 0); 909 resetWMSetInsets(); 910 if (!isEmbedded()) { 911 setReparented(false); 912 } 913 winAttr.isResizable = resizable; 914 if ((fs & MWM_FUNC_ALL) != 0) { |