}
}
+ JSONObject meta = null;
+ if (((JSONObject) json).containsKey("meta")) {
+ meta = ((JSONObject) json).get("meta").isObject();
+ if (meta.containsKey("repaintAll")) {
+ view.clear();
+ idToPaintable.clear();
+ paintableToId.clear();
+ }
+ }
+
// Process changes
final JSONArray changes = (JSONArray) ((JSONObject) json)
.get("changes");
}
}
- if (((JSONObject) json).containsKey("meta")) {
- final JSONObject meta = ((JSONObject) json).get("meta").isObject();
+ if (meta != null) {
if (meta.containsKey("focus")) {
final String focusPid = meta.get("focus").isString()
.stringValue();
outWriter.print("\"changes\":[");
+ // re-get mainwindow - may have been changed
+ Window newWindow = getApplicationWindow(request, application);
+ if (newWindow != window) {
+ window = newWindow;
+ repaintAll = true;
+ }
+
JsonPaintTarget paintTarget = new JsonPaintTarget(this,
outWriter, !repaintAll);
outWriter.print("]"); // close changes
outWriter.print(", \"meta\" : {");
- final boolean metaOpen = false;
+ boolean metaOpen = false;
+
+ if (repaintAll) {
+ metaOpen = true;
+ outWriter.write("\"repaintAll\":true");
+ }
// add meta instruction for client to set focus if it is set
final Paintable f = (Paintable) application.consumeFocus();