mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
csi: CSI Ps ; Ps ; Ps t: report logical pixels
This commit is contained in:
parent
4f145bed33
commit
e93757198a
1 changed files with 8 additions and 5 deletions
13
csi.c
13
csi.c
|
|
@ -817,7 +817,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
|
||||
if (x >= 0 && y >= 0) {
|
||||
char reply[64];
|
||||
snprintf(reply, sizeof(reply), "\033[3;%d;%dt", x, y);
|
||||
snprintf(reply, sizeof(reply), "\033[3;%d;%dt",
|
||||
x / term->scale, y / term->scale);
|
||||
term_to_slave(term, reply, strlen(reply));
|
||||
}
|
||||
break;
|
||||
|
|
@ -847,7 +848,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
|
||||
if (width >= 0 && height >= 0) {
|
||||
char reply[64];
|
||||
snprintf(reply, sizeof(reply), "\033[4;%d;%dt", height, width);
|
||||
snprintf(reply, sizeof(reply), "\033[4;%d;%dt",
|
||||
height / term->scale, width / term->scale);
|
||||
term_to_slave(term, reply, strlen(reply));
|
||||
}
|
||||
break;
|
||||
|
|
@ -870,7 +872,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
case 16: { /* report cell size in pixels */
|
||||
char reply[64];
|
||||
snprintf(reply, sizeof(reply), "\033[6;%d;%dt",
|
||||
term->cell_height, term->cell_width);
|
||||
term->cell_height / term->scale,
|
||||
term->cell_width / term->scale);
|
||||
term_to_slave(term, reply, strlen(reply));
|
||||
break;
|
||||
}
|
||||
|
|
@ -887,8 +890,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
tll_foreach(term->window->on_outputs, it) {
|
||||
char reply[64];
|
||||
snprintf(reply, sizeof(reply), "\033[9;%d;%dt",
|
||||
it->item->dim.px_scaled.height / term->cell_height,
|
||||
it->item->dim.px_scaled.width / term->cell_width);
|
||||
it->item->dim.px_real.height / term->cell_height / term->scale,
|
||||
it->item->dim.px_real.width / term->cell_width) / term->scale;
|
||||
term_to_slave(term, reply, strlen(reply));
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue