@@ -2641,7 +2641,18 @@ public void run() {
2641
2641
* C_$.createC_$Window_ = Console.createC_$Window;
2642
2642
* C_$.createConsoleWindow = C_$.createC_$Window = function (parentEl) {
2643
2643
* var console = C_$.createC_$Window_ (parentEl);
2644
- * console.style.display = "none";
2644
+ * if (O$.isIE) {
2645
+ * var consoleStyle = console.style;
2646
+ * consoleStyle.display = "block"
2647
+ * consoleStyle.position = "absolute";
2648
+ * consoleStyle.width = "200px";
2649
+ * consoleStyle.height = "200px";
2650
+ * consoleStyle.left = "-400px";
2651
+ * consoleStyle.top = "-400px";
2652
+ * consoleStyle.overflow = "hidden";
2653
+ * } else {
2654
+ * console.style.display = "none";
2655
+ * }
2645
2656
* $wt.widgets.Display.insertOpenConsoleLink(console);
2646
2657
* return console;
2647
2658
* };
@@ -3375,9 +3386,7 @@ public void run() {
3375
3386
if (msgs .length != 0 ) {
3376
3387
messageLoop = true ;
3377
3388
// System.out.println("msgs.legnth" + msgs.length);
3378
- MESSAGE [] defered = new MESSAGE [0 ];
3379
-
3380
- int defsize = 0 ;
3389
+ int idx = 0 ;
3381
3390
for (int i = msgs .length - 1 ; i >= 0 ; i --) {
3382
3391
MESSAGE m1 = msgs [i ];
3383
3392
if (m1 == null ) {
@@ -3393,31 +3402,33 @@ public void run() {
3393
3402
}
3394
3403
3395
3404
if (m1 .type == MESSAGE .CONTROL_LAYOUT ){
3396
- if (m1 .control .parent != null && m1 .control .parent .waitingForLayout ){
3405
+ Composite p = m1 .control .parent ;
3406
+ if (p != null && p .waitingForLayout ){
3397
3407
// System.out.println(m1.control.getName()+ " is waiting for parent " +
3398
- // m1.control.parent .getName());
3408
+ // p .getName());
3399
3409
m1 .defer = true ;
3400
- defered [defsize ++] = m1 ;
3401
3410
}
3402
3411
}
3403
3412
3404
3413
}
3405
3414
long time = 0 ;
3406
3415
3416
+ boolean deferred = false ;
3407
3417
3408
3418
for (int i = 0 ; i < msgs .length ; i ++) {
3409
3419
// for (int i = msgs.length - 1; i >= 0; i--) {
3410
3420
MESSAGE m = msgs [i ];
3411
3421
3412
3422
if (m != null && m .defer ){
3423
+ deferred = true ;
3413
3424
// System.out.println("deffer " + m.control.getName());
3414
3425
continue ;
3415
3426
}
3416
3427
msgs [i ] = null ;
3417
3428
if (m != null && m .type == MESSAGE .CONTROL_LAYOUT ) {
3418
3429
m .control .waitingForLayout = false ;
3419
3430
if (!m .control .isVisible ()) { continue ; }
3420
- Date d = new Date ();
3431
+ long d = new Date (). getTime ();
3421
3432
Composite c = (Composite ) m .control ;
3422
3433
if (c .waitingForLayoutWithResize ){
3423
3434
c .setResizeChildren (false );
@@ -3437,41 +3448,50 @@ public void run() {
3437
3448
} else {
3438
3449
c .layout ();
3439
3450
}
3440
- time += new Date ().getTime () - d . getTime () ;
3451
+ time += new Date ().getTime () - d ;
3441
3452
// System.err.println(c.getName() + " cost " + (time));
3442
3453
if (time > 200 ) {
3443
3454
// System.out.println("before deferring:" + msgs.length);
3444
- for (int j = i + 1 ; j < msgs .length ; j ++) {
3445
- msgs [j - i - 1 ] = msgs [j ];
3455
+ idx = 0 ;
3456
+ if (deferred ) {
3457
+ for (int j = 0 ; j < i + 1 ; j ++) {
3458
+ m = msgs [j ];
3459
+ if (m != null && m .defer ) {
3460
+ msgs [idx ++] = m ;
3461
+ }
3462
+ msgs [j ] = null ;
3463
+ }
3446
3464
}
3447
- // for (int j = 0; j < i; j++) {
3448
- // msgs[msgs.length - 1 - j] = null;
3449
- // }
3450
- int length = msgs .length - i - 1 ;
3451
- for (int j = 0 ; j < defsize ; j ++){
3452
- msgs [length + j ] = defered [j ];
3465
+ for (int j = i + 1 ; j < msgs .length ; j ++) {
3466
+ msgs [idx ++] = msgs [j ];
3467
+ msgs [j ] = null ;
3453
3468
}
3454
3469
/**
3455
3470
* @j2sNativeSrc
3456
- * msgs.length -= i + 1 ;
3471
+ * msgs.length = idx ;
3457
3472
* @j2sNative
3458
- * a.length -= f + 1 ;
3473
+ * a.length = b ;
3459
3474
*/ {}
3460
3475
// System.out.println("after deferring:" + msgs.length);
3461
3476
return ;
3462
3477
}
3463
3478
}
3464
3479
}
3480
+ idx = 0 ;
3481
+ if (deferred ) {
3482
+ for (int j = 0 ; j < msgs .length ; j ++){
3483
+ MESSAGE m = msgs [j ];
3484
+ if (m != null && m .defer ) {
3485
+ msgs [idx ++] = m ;
3486
+ }
3487
+ }
3488
+ }
3465
3489
/**
3466
3490
* @j2sNativeSrc
3467
- * msgs.length = 0 ;
3491
+ * msgs.length = idx ;
3468
3492
* @j2sNative
3469
- * a.length = 0 ;
3493
+ * a.length = b ;
3470
3494
*/ {}
3471
- Display .this .msgs = defered ;
3472
- // for(int j = 0; j < defsize; j++){
3473
- // msgs[j] = defered[j];
3474
- // }
3475
3495
}
3476
3496
}
3477
3497
}, 100 );
@@ -3746,6 +3766,7 @@ void releaseDisplay () {
3746
3766
filterTable = null ;
3747
3767
if (messageProc != 0 ) {
3748
3768
window .clearInterval (messageProc );
3769
+ messageProc = 0 ;
3749
3770
}
3750
3771
msgs = null ;
3751
3772
}
@@ -4016,7 +4037,7 @@ boolean runPopups () {
4016
4037
boolean runTimer (int id ) {
4017
4038
if (timerList != null && timerIds != null ) {
4018
4039
int index = 0 ;
4019
- while (index <timerIds .length ) {
4040
+ while (index < timerIds .length ) {
4020
4041
if (timerIds [index ] == id ) {
4021
4042
//OS.KillTimer (hwndMessage, timerIds [index]);
4022
4043
window .clearInterval (timerIds [index ]);
0 commit comments