aboutsummaryrefslogtreecommitdiffstats
path: root/display.c
diff options
context:
space:
mode:
authorAraki Ken <arakiken@users.sf.net>2013-01-28 15:27:27 +0000
committerTatsuya Kinoshita <tats@debian.org>2014-12-06 11:47:04 +0000
commitf4268d8d18e57952b046c1bb6ab2aeeac145c310 (patch)
tree32445358c7c1ebac283d6e364ca3b18b12748a42 /display.c
parentMerge branch 'bug/parsetagx-crash' (diff)
downloadw3m-f4268d8d18e57952b046c1bb6ab2aeeac145c310.tar.gz
w3m-f4268d8d18e57952b046c1bb6ab2aeeac145c310.zip
Support remote image by OSC 5379 show_picture sequence.
Diffstat (limited to 'display.c')
-rw-r--r--display.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/display.c b/display.c
index 2fe1183..471c8af 100644
--- a/display.c
+++ b/display.c
@@ -487,7 +487,7 @@ displayBuffer(Buffer *buf, int mode)
term_title(conv_to_system(buf->buffername));
refresh();
#ifdef USE_IMAGE
- if (activeImage && displayImage && buf->img) {
+ if (activeImage && displayImage && buf->img && buf->image_loaded) {
drawImage();
}
#endif
@@ -521,7 +521,10 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
break;
}
if (hseq >= 0 && an->hseq == hseq) {
+ int hasImage = 0;
for (i = an->start.pos; i < an->end.pos; i++) {
+ if (l->propBuf[i] & PE_IMAGE)
+ hasImage = 1 ;
if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) {
if (active)
l->propBuf[i] |= PE_ACTIVE;
@@ -529,7 +532,8 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
l->propBuf[i] &= ~PE_ACTIVE;
}
}
- if (active)
+ if (active &&
+ (! support_remote_image || ! hasImage))
redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY,
an->start.pos, an->end.pos);
}
@@ -855,14 +859,16 @@ redrawLineImage(Buffer *buf, Line *l, int i)
y = (int)(i * pixel_per_line);
sx = (int)((rcol - COLPOS(l, a->start.pos)) * pixel_per_char);
sy = (int)((l->linenumber - image->y) * pixel_per_line);
- if (sx == 0 && x + image->xoffset >= 0)
- x += image->xoffset;
- else
- sx -= image->xoffset;
- if (sy == 0 && y + image->yoffset >= 0)
- y += image->yoffset;
- else
- sy -= image->yoffset;
+ if (! support_remote_image) {
+ if (sx == 0 && x + image->xoffset >= 0)
+ x += image->xoffset;
+ else
+ sx -= image->xoffset;
+ if (sy == 0 && y + image->yoffset >= 0)
+ y += image->yoffset;
+ else
+ sy -= image->yoffset;
+ }
if (image->width > 0)
w = image->width - sx;
else