package org.nibiru.ui.gwt.loop;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.user.client.ui.RootPanel;

import org.nibiru.ui.core.api.loop.Looper;

import javax.inject.Inject;

import static com.google.common.base.Preconditions.checkNotNull;

public class SchedulerLooper implements Looper {
	private final Scheduler scheduler;

	@Inject
	public SchedulerLooper(Scheduler scheduler) {
		this.scheduler = checkNotNull(scheduler);
	}

    @Override
    public void post(final Runnable runnable) {
        checkNotNull(runnable);
        RootPanel.get().setVisible(false);
        scheduler.scheduleDeferred(() -> {
            runnable.run();
            RootPanel.get().setVisible(true);
        });
    }
}

package org.nibiru.ui.gwt.loop;

import static com.google.common.base.Preconditions.checkNotNull;

import javax.inject.Inject;

import org.nibiru.ui.core.api.loop.Looper;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;

public class SchedulerLooper implements Looper {
	private final Scheduler scheduler;

	@Inject
	public SchedulerLooper(Scheduler scheduler) {
		this.scheduler = checkNotNull(scheduler);
	}

	@Override
	public void post(final Runnable runnable) {
		checkNotNull(runnable);
		scheduler.scheduleDeferred(new ScheduledCommand() {
			@Override
			public void execute() {
				runnable.run();
			}
		});
	}
}

--- 
+++ 
@@ -1,13 +1,13 @@
 package org.nibiru.ui.gwt.loop;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.user.client.ui.RootPanel;
+
+import org.nibiru.ui.core.api.loop.Looper;
 
 import javax.inject.Inject;
 
-import org.nibiru.ui.core.api.loop.Looper;
-
-import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 public class SchedulerLooper implements Looper {
 	private final Scheduler scheduler;
@@ -17,14 +17,13 @@
 		this.scheduler = checkNotNull(scheduler);
 	}
 
-	@Override
-	public void post(final Runnable runnable) {
-		checkNotNull(runnable);
-		scheduler.scheduleDeferred(new ScheduledCommand() {
-			@Override
-			public void execute() {
-				runnable.run();
-			}
-		});
-	}
+    @Override
+    public void post(final Runnable runnable) {
+        checkNotNull(runnable);
+        RootPanel.get().setVisible(false);
+        scheduler.scheduleDeferred(() -> {
+            runnable.run();
+            RootPanel.get().setVisible(true);
+        });
+    }
 }
Hide the root panel during the looper post to avoid rendering widgets while computing the layout
