aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-13 17:44:23 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-13 17:47:16 +0000
commitd482bf0a304b8224499bf9de9e0781518106ec7c (patch)
treeafc68b49ecaa21a3f1d5a089cfa5a7b18a95d654 /terminal.h
parentinput: maximize: unset fullscreen before toggling maximized state (diff)
sixel: improve handling of images when reflowing the grids
Update the sixels' 'row' attribute when re-flowing a grid, to ensure it is rendered at the correct place. This should work in most cases, but will break when the cell size has changed (e.g. font size increase/decrease, or a DPI change). This patch also moves the sixel image list from the terminal struct into the grid struct. The sixels are per-grid after all.
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/terminal.h b/terminal.h
index 92082d8c..90379ba1 100644
--- a/terminal.h
+++ b/terminal.h
@@ -86,6 +86,15 @@ struct row {
bool linebreak;
};
+struct sixel {
+ void *data;
+ pixman_image_t *pix;
+ int width;
+ int height;
+ int rows;
+ struct coord pos;
+};
+
struct grid {
int num_rows;
int num_cols;
@@ -97,6 +106,7 @@ struct grid {
tll(struct damage) damage;
tll(struct damage) scroll_damage;
+ tll(struct sixel) sixel_images;
};
struct vt_subparams {
@@ -175,16 +185,6 @@ struct ptmx_buffer {
size_t idx;
};
-struct sixel {
- void *data;
- pixman_image_t *pix;
- int width;
- int height;
- int rows;
- const struct grid *grid;
- struct coord pos;
-};
-
enum term_surface {
TERM_SURF_NONE,
TERM_SURF_GRID,
@@ -417,8 +417,6 @@ struct terminal {
unsigned max_height; /* Maximum image height, in pixels */
} sixel;
- tll(struct sixel) sixel_images;
-
bool hold_at_exit;
bool is_shutting_down;
void (*shutdown_cb)(void *data, int exit_code);