allow larger sixel images

This commit is contained in:
Kevin Lamonte 2020-06-21 17:43:54 -05:00
parent f980291bcb
commit 75324b1211
2 changed files with 17 additions and 13 deletions

View file

@ -641,6 +641,8 @@ public class TTerminalWidget extends TScrollableWidget
int width = getDisplayWidth();
boolean syncEmulator = false;
// If the emulator notified of an update, sync.
synchronized (dirtyQueue) {
if (dirtyQueue.size() > 0) {
dirtyQueue.remove(dirtyQueue.size() - 1);
@ -648,6 +650,13 @@ public class TTerminalWidget extends TScrollableWidget
}
}
// If it has been longer than 250 milliseconds, sync.
long now = System.currentTimeMillis();
if ((now - lastUpdateTime) > 250) {
syncEmulator = true;
}
lastUpdateTime = now;
if ((syncEmulator == true)
|| (display == null)
) {
@ -1386,15 +1395,7 @@ public class TTerminalWidget extends TScrollableWidget
* Called by emulator when fresh data has come in.
*/
public void displayChanged() {
if (emulator != null) {
// Force sync here: EMCA48.run() thread might be setting
// dirty=true while TTerminalWdiget.draw() is setting
// dirty=false. If these writes start interleaving, the display
// stops getting updated.
synchronized (emulator) {
setDirty();
}
} else {
synchronized (emulator) {
setDirty();
}
TApplication app = getApplication();

View file

@ -72,14 +72,17 @@ public class Sixel {
private static int HEIGHT_INCREASE = 400;
/**
* Maximum width in pixels.
* Maximum width in pixels. Xterm's max is 1000, but that's pretty
* limited for today's systems, so we will support up to "4K Ultra HD"
* width and three times that height.
*/
private static int MAX_WIDTH = 1000;
private static int MAX_WIDTH = 1 * 3840;
/**
* Maximum height in pixels.
* Maximum height in pixels. Xterm's max is 1000, but that's pretty
* limited for today's systems, so we will support up to "4K Ultra HD".
*/
private static int MAX_HEIGHT = 1000;
private static int MAX_HEIGHT = 3 * 2160;
/**
* Current scanning state.