Skip to content

Commit e26056f

Browse files
author
neil
committed
auto refresh resolution
1 parent 42aa43c commit e26056f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

anyvm.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,9 @@ def fatal(msg):
660660
661661
const setEncodings = new Uint8Array([
662662
2, 0,
663-
0, 1,
664-
0, 0, 0, 0
663+
0, 2,
664+
0, 0, 0, 0,
665+
255, 255, 255, 33 // DesktopSize pseudo-encoding (-223)
665666
]);
666667
ws.send(setEncodings);
667668
@@ -699,6 +700,11 @@ def fatal(msg):
699700
const h = view.getUint16(6);
700701
const enc = view.getInt32(8);
701702
offset += 12;
703+
704+
if (enc === -223) { // VM resolution changed
705+
location.reload();
706+
return;
707+
}
702708
703709
// Detect VM software cursor by looking for small updates near host mouse position
704710
if (isCheckingCursor && !cursorDetected) {

0 commit comments

Comments
 (0)