jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
changeset 115 e270c597a3ad
parent 2 90ce3da70b43
child 118 35b334a806ab
equal deleted inserted replaced
114:a777da6f3f55 115:e270c597a3ad
    96         super.postInit(params);
    96         super.postInit(params);
    97         // The lines that follow need to be in a postInit, so they
    97         // The lines that follow need to be in a postInit, so they
    98         // happen after the X window is created.
    98         // happen after the X window is created.
    99         initResizability();
    99         initResizability();
   100         updateSizeHints(dimensions);
   100         updateSizeHints(dimensions);
   101         content = createContent(dimensions);
   101         content = XContentWindow.createContent(this);
   102         content.initialize();
       
   103         if (warningWindow != null) {
   102         if (warningWindow != null) {
   104             warningWindow.toFront();
   103             warningWindow.toFront();
   105         }
   104         }
   106         focusProxy = createFocusProxy();
   105         focusProxy = createFocusProxy();
   107     }
   106     }
   158                 }
   157                 }
   159             }
   158             }
   160         }
   159         }
   161     }
   160     }
   162 
   161 
   163     XContentWindow createContent(WindowDimensions dims) {
       
   164         Rectangle rec = dims.getBounds();
       
   165         // Fix for  - set the location of the content window to the (-left inset, -top inset)
       
   166         Insets ins = dims.getInsets();
       
   167         if (ins != null) {
       
   168             rec.x = -ins.left;
       
   169             rec.y = -ins.top;
       
   170         } else {
       
   171             rec.x = 0;
       
   172             rec.y = 0;
       
   173         }
       
   174         return new XContentWindow(this, rec);
       
   175     }
       
   176 
       
   177     XFocusProxyWindow createFocusProxy() {
   162     XFocusProxyWindow createFocusProxy() {
   178         return new XFocusProxyWindow(this);
   163         return new XFocusProxyWindow(this);
   179     }
   164     }
   180 
   165 
   181     protected XAtomList getWMProtocols() {
   166     protected XAtomList getWMProtocols() {
   284                 setReparented(true);
   269                 setReparented(true);
   285                 insets_corrected = true;
   270                 insets_corrected = true;
   286                 return;
   271                 return;
   287             }
   272             }
   288             Component t = (Component)target;
   273             Component t = (Component)target;
   289             if (getDecorations() == winAttr.AWT_DECOR_NONE) {
   274             if (getDecorations() == XWindowAttributesData.AWT_DECOR_NONE) {
   290                 setReparented(true);
   275                 setReparented(true);
   291                 insets_corrected = true;
   276                 insets_corrected = true;
   292                 reshape(dimensions, SET_SIZE, false);
   277                 reshape(dimensions, SET_SIZE, false);
   293             } else if (xe.get_parent() == root) {
   278             } else if (xe.get_parent() == root) {
   294                 configure_seen = false;
   279                 configure_seen = false;
   649             insLog.log(Level.FINE, "reparented={0}, visible={1}, WM={2}, decorations={3}",
   634             insLog.log(Level.FINE, "reparented={0}, visible={1}, WM={2}, decorations={3}",
   650                     new Object[] {isReparented(), isVisible(), runningWM, getDecorations()});
   635                     new Object[] {isReparented(), isVisible(), runningWM, getDecorations()});
   651         }
   636         }
   652         if (!isReparented() && isVisible() && runningWM != XWM.NO_WM
   637         if (!isReparented() && isVisible() && runningWM != XWM.NO_WM
   653                 &&  !XWM.isNonReparentingWM()
   638                 &&  !XWM.isNonReparentingWM()
   654                 && getDecorations() != winAttr.AWT_DECOR_NONE) {
   639                 && getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
   655             insLog.fine("- visible but not reparented, skipping");
   640             insLog.fine("- visible but not reparented, skipping");
   656             return;
   641             return;
   657         }
   642         }
   658         //Last chance to correct insets
   643         //Last chance to correct insets
   659         if (!insets_corrected && getDecorations() != winAttr.AWT_DECOR_NONE) {
   644         if (!insets_corrected && getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
   660             long parent = XlibUtil.getParentWindow(window);
   645             long parent = XlibUtil.getParentWindow(window);
   661             Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
   646             Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null;
   662             if (insLog.isLoggable(Level.FINER)) {
   647             if (insLog.isLoggable(Level.FINER)) {
   663                 if (correctWM != null) {
   648                 if (correctWM != null) {
   664                     insLog.finer("Configure notify - insets : " + correctWM);
   649                     insLog.finer("Configure notify - insets : " + correctWM);
   868 
   853 
   869     public int getHeight() {
   854     public int getHeight() {
   870         return getSize().height;
   855         return getSize().height;
   871     }
   856     }
   872 
   857 
   873     public WindowDimensions getDimensions() {
   858     final public WindowDimensions getDimensions() {
   874         return dimensions;
   859         return dimensions;
   875     }
   860     }
   876 
   861 
   877     public Point getLocationOnScreen() {
   862     public Point getLocationOnScreen() {
   878         XToolkit.awtLock();
   863         XToolkit.awtLock();