@@ 55,4 55,4 @@ option('use-fontconfig',
value : 'disabled',
yield : true)
-option('version', type : 'string', value : '0.4.0')
+option('version', type : 'string', value : '0.5.1')
@@ 1643,8 1643,8 @@ void fonsDeleteInternal(FONScontext* stash)
if (stash->fonts) free(stash->fonts);
if (stash->texData) free(stash->texData);
if (stash->scratch) free(stash->scratch);
- free(stash);
fons__tt_done(stash);
+ free(stash);
}
void fonsSetErrorCallback(FONScontext* stash, void (*callback)(void* uptr, int error, int val), void* uptr)
@@ 20,6 20,8 @@
#include "base_internal.h"
+#define UNUSED __attribute__((unused))
+
#define DEFAULT_FG 0xddddddff
#define DEFAULT_BG 0x222222ff
@@ 317,10 319,62 @@ _screen_bell(void *data)
return 0;
}
+static int
+_screen_damage(VTermRect rect UNUSED, void *user UNUSED)
+{
+ // we don't use it, but must be implemented
+ return 0;
+}
+
+static int
+_screen_moverect(VTermRect dest UNUSED, VTermRect src UNUSED,
+ void *user UNUSED)
+{
+ // we don't use it, but must be implemented
+ return 0;
+}
+
+static int
+_screen_movecursor(VTermPos pos UNUSED, VTermPos oldpos UNUSED,
+ int visible UNUSED, void *user UNUSED)
+{
+ // we don't use it, but must be implemented
+ return 0;
+}
+
+static int
+_screen_sb_pushline(int cols UNUSED, const VTermScreenCell *cells UNUSED,
+ void *user UNUSED)
+{
+ // we don't use it, but must be implemented
+ return 0;
+}
+
+static int
+_screen_sb_popline(int cols UNUSED, VTermScreenCell *cells UNUSED,
+ void *user UNUSED)
+{
+ // we don't use it, but must be implemented
+ return 0;
+}
+
+static int
+_screen_sb_clear(void* user UNUSED)
+{
+ // we don't use it, but must be implemented
+ return 0;
+}
+
static const VTermScreenCallbacks screen_callbacks = {
+ .damage = _screen_damage,
+ .moverect = _screen_moverect,
+ .movecursor = _screen_movecursor,
.settermprop = _screen_settermprop,
.bell = _screen_bell,
- .resize = _screen_resize
+ .resize = _screen_resize,
+ .sb_pushline = _screen_sb_pushline,
+ .sb_popline = _screen_sb_popline,
+ .sb_clear = _screen_sb_clear
};
static inline __attribute__((always_inline)) int
@@ 556,6 610,7 @@ _term_init(d2tk_atom_body_pty_t *vpty, d2tk_base_pty_cb_t cb, void *data,
vpty->screen = vterm_obtain_screen(vpty->vterm);
vterm_screen_set_callbacks(vpty->screen, &screen_callbacks, vpty);
+ vterm_screen_set_damage_merge(vpty->screen, VTERM_DAMAGE_SCROLL);
vterm_screen_reset(vpty->screen, 1);
return 0;
@@ 911,7 966,10 @@ _term_resize(d2tk_atom_body_pty_t *vpty, d2tk_coord_t ncols,
{
if( (nrows != vpty->nrows) || (ncols != vpty->ncols) )
{
+ fprintf(stderr, "%d %d -> %d %d\n", vpty->ncols, vpty->nrows, ncols, nrows);
+
vterm_set_size(vpty->vterm, nrows, ncols);
+ vterm_screen_flush_damage(vpty->screen);
}
}
@@ 1240,7 1298,7 @@ d2tk_pty_not_end(d2tk_pty_t *pty)
}
D2TK_API d2tk_pty_t *
-d2tk_pty_next(d2tk_pty_t *pty __attribute__((unused)))
+d2tk_pty_next(d2tk_pty_t *pty UNUSED)
{
return NULL;
}