704 } 705 if (correctWM != null) { 706 handleCorrectInsets(correctWM); 707 } else { 708 //Only one attempt to correct insets is made (to lower risk) 709 //if insets are still not available we simply set the flag 710 insets_corrected = true; 711 } 712 } 713 714 updateChildrenSizes(); 715 716 // Bounds of the window 717 Rectangle targetBounds = AWTAccessor.getComponentAccessor().getBounds((Component)target); 718 719 Point newLocation = targetBounds.getLocation(); 720 if (xe.get_send_event() || runningWM == XWM.NO_WM || XWM.isNonReparentingWM()) { 721 // Location, Client size + insets 722 newLocation = new Point(xe.get_x() - currentInsets.left, xe.get_y() - currentInsets.top); 723 } else { 724 // CDE/MWM/Metacity/Sawfish bug: if shell is resized using 725 // top or left border, we don't receive synthetic 726 // ConfigureNotify, only the one from X with zero 727 // coordinates. This is the workaround to get real 728 // location, 6261336 729 switch (XWM.getWMID()) { 730 case XWM.CDE_WM: 731 case XWM.MOTIF_WM: 732 case XWM.METACITY_WM: 733 case XWM.SAWFISH_WM: 734 { 735 Point xlocation = queryXLocation(); 736 if (log.isLoggable(PlatformLogger.FINE)) log.fine("New X location: {0}", xlocation); 737 if (xlocation != null) { 738 newLocation = xlocation; 739 } 740 break; 741 } 742 default: 743 break; 744 } 745 } 746 747 WindowDimensions newDimensions = 748 new WindowDimensions(newLocation, 749 new Dimension(xe.get_width(), xe.get_height()), 750 copy(currentInsets), 751 true); 752 | 704 } 705 if (correctWM != null) { 706 handleCorrectInsets(correctWM); 707 } else { 708 //Only one attempt to correct insets is made (to lower risk) 709 //if insets are still not available we simply set the flag 710 insets_corrected = true; 711 } 712 } 713 714 updateChildrenSizes(); 715 716 // Bounds of the window 717 Rectangle targetBounds = AWTAccessor.getComponentAccessor().getBounds((Component)target); 718 719 Point newLocation = targetBounds.getLocation(); 720 if (xe.get_send_event() || runningWM == XWM.NO_WM || XWM.isNonReparentingWM()) { 721 // Location, Client size + insets 722 newLocation = new Point(xe.get_x() - currentInsets.left, xe.get_y() - currentInsets.top); 723 } else { 724 // ICCCM 4.1.5 states that a real ConfigureNotify will be sent when 725 // a window is resized but the client can not tell if the window was 726 // moved or not. The client should consider the position as unkown 727 // and use TranslateCoordinates to find the actual position. 728 // 729 // TODO this should be the default for every case. 730 switch (XWM.getWMID()) { 731 case XWM.CDE_WM: 732 case XWM.MOTIF_WM: 733 case XWM.METACITY_WM: 734 case XWM.MUTTER_WM: 735 case XWM.SAWFISH_WM: 736 { 737 Point xlocation = queryXLocation(); 738 if (log.isLoggable(PlatformLogger.FINE)) log.fine("New X location: {0}", xlocation); 739 if (xlocation != null) { 740 newLocation = xlocation; 741 } 742 break; 743 } 744 default: 745 break; 746 } 747 } 748 749 WindowDimensions newDimensions = 750 new WindowDimensions(newLocation, 751 new Dimension(xe.get_width(), xe.get_height()), 752 copy(currentInsets), 753 true); 754 |