@@ -425,6 +425,11 @@ public Display () {
425425 * Constructs a new instance of this class using the parameter.
426426 *
427427 * @param data the device data
428+ *
429+ * @j2sKeep As there are some members intializing
430+ * which require this constructor! The members is
431+ * cursors and displays.
432+ * TODO: May require bug fix!
428433 */
429434public Display (DeviceData data ) {
430435 super (data );
@@ -3031,12 +3036,23 @@ public boolean readAndDispatch () {
30313036 return runAsyncMessages (false);
30323037 */
30333038 messageProc = window .setInterval (new RunnableCompatibility () {
3039+ private boolean messageLoop = false ;
30343040 public void run () {
30353041// System.out.println("I'm entering the run");
30363042// System.out.println("msg " + Display.this.msgs);
30373043// List layoutQueue = new ArrayList();
30383044 MESSAGE [] msgs = Display .this .msgs ;
3045+ if (msgs .length == 0 && messageLoop )
3046+ /**
3047+ * @j2sNative
3048+ * var layoutFinished = window["j2s.swt.shell.finish.layout"];
3049+ * if (layoutFinished != null) {
3050+ * layoutFinished ();
3051+ * }
3052+ * this.messageLoop = false;
3053+ */ { }
30393054 if (msgs .length != 0 ) {
3055+ messageLoop = true ;
30403056// System.out.println("msgs.legnth" + msgs.length);
30413057 MESSAGE [] defered = new MESSAGE [0 ];
30423058
@@ -3117,7 +3133,7 @@ public void run() {
31173133 * @j2sNativeSrc
31183134 * msgs.length -= i + 1;
31193135 * @j2sNative
3120- * a.length -= d + 1;
3136+ * a.length -= f + 1;
31213137 */ {}
31223138// System.out.println("after deferring:" + msgs.length);
31233139 return ;
0 commit comments