diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-04-18 21:20:09 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-04-18 21:20:09 +0000 |
| commit | e93757198a6894ac36939b96a16a151c78e86a6f (patch) | |
| tree | a5cb38e4477e0bb8692574b6f94f252be2b6f46e | |
| parent | shm: #ifdef conditional code to measure total size of SHM allocations (diff) | |
csi: CSI Ps ; Ps ; Ps t: report logical pixels
| -rw-r--r-- | csi.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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; } |
