@@ -235,6 +235,7 @@ void bringToTop () {
235
235
&& (style .height == null || style .height .length () == 0 )){
236
236
setSize (this .width , this .height );
237
237
}
238
+ setLocation (this .left , this .top );
238
239
/**
239
240
* @j2sNative
240
241
* var title = this.getText();
@@ -571,7 +572,18 @@ public void run() {
571
572
handle = document .createElement ("DIV" );
572
573
handle .className = "shell-default shell-trim" ;
573
574
handle .style .visibility = "hidden" ;
574
- nextWindowLocation ();
575
+
576
+ //nextWindowLocation();
577
+
578
+ if (window .defaultWindowWidth == null ) {
579
+ window .defaultWindowWidth = "768" ;
580
+ }
581
+ if (window .defaultWindowHeight == null ) {
582
+ window .defaultWindowHeight = "557" ;
583
+ }
584
+ width = Integer .parseInt (window .defaultWindowWidth );
585
+ height = Integer .parseInt (window .defaultWindowHeight );
586
+
575
587
this .width = 768 ;
576
588
this .height = 557 ;
577
589
// if ((style & SWT.NO_TRIM) == 0 & (style & SWT.RESIZE) != 0) {
@@ -668,44 +680,36 @@ public void run() {
668
680
669
681
}
670
682
671
- private void nextWindowLocation () {
683
+ void nextWindowLocation (int wHint , int hHint ) {
684
+ int delta = OS .getStringPlainHeight ("A" ) + 4 + 6 + 1 ;
672
685
if (window .defaultWindowLeft == null ) {
673
- window .defaultWindowLeft = "132 " ;
686
+ window .defaultWindowLeft = "64 " ;
674
687
} else {
675
688
int num = Integer .parseInt ("" + window .defaultWindowLeft );
676
- if (this .parent == null ) num += 32 ;
677
- if (num > getMonitor ().clientWidth ) {
678
- num = 32 ;
689
+ if (this .parent == null ) num += delta ;
690
+ if (num + wHint > getMonitor ().clientWidth ) {
691
+ num = delta ;
679
692
}
680
693
window .defaultWindowLeft = "" + num ;
681
694
}
682
695
if (window .defaultWindowTop == null ) {
683
- window .defaultWindowTop = "32 " ;
696
+ window .defaultWindowTop = "64 " ;
684
697
} else {
685
698
int num = Integer .parseInt ("" + window .defaultWindowTop );
686
- if (this .parent == null ) num += 32 ;
687
- if (num > getMonitor ().clientHeight ) {
688
- num = 32 ;
699
+ if (this .parent == null ) num += delta ;
700
+ if (num + hHint > getMonitor ().clientHeight ) {
701
+ num = delta ;
689
702
}
690
703
window .defaultWindowTop = "" + num ;
691
704
}
692
- if (window .defaultWindowWidth == null ) {
693
- window .defaultWindowWidth = "768" ;
694
- }
695
- if (window .defaultWindowHeight == null ) {
696
- window .defaultWindowHeight = "557" ;
697
- }
698
705
left = Integer .parseInt (window .defaultWindowLeft );
699
706
top = Integer .parseInt (window .defaultWindowTop );
700
707
if (parent != null ) {
701
- left += 32 ;
702
- top += 32 ;
708
+ left += delta ;
709
+ top += delta ;
703
710
}
704
711
left += OS .getFixedBodyOffsetLeft ();
705
712
top += OS .getFixedBodyOffsetTop ();
706
-
707
- width = Integer .parseInt (window .defaultWindowWidth );
708
- height = Integer .parseInt (window .defaultWindowHeight );
709
713
}
710
714
711
715
void addModalLayer () {
@@ -2156,6 +2160,7 @@ public void run() {
2156
2160
}
2157
2161
shellTitle = document .createElement ("DIV" );
2158
2162
shellTitle .className = "shell-title-text" ;
2163
+ shellTitle .appendChild (document .createTextNode ("" + (char ) 160 ));
2159
2164
2160
2165
/**
2161
2166
* Ubuntu's Firefox has different active caption background color!
0 commit comments