Merge branch 'scale-outline-of-unfocused-block-cursor'

This commit is contained in:
Daniel Eklöf 2021-12-29 11:52:48 +01:00
commit 0a656d75d4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 9 additions and 4 deletions

View file

@ -54,6 +54,9 @@
* `[scrollback].multiplier` is now applied in “alternate scroll” mode, * `[scrollback].multiplier` is now applied in “alternate scroll” mode,
where scroll events are translated to fake arrow key presses on the where scroll events are translated to fake arrow key presses on the
alt screen (https://codeberg.org/dnkl/foot/issues/859). alt screen (https://codeberg.org/dnkl/foot/issues/859).
* The width of the block cursors outline in an unfocused window is
now scaled by the output scaling factor (“desktop
scaling”). Previously, it was always 1px.
### Deprecated ### Deprecated

View file

@ -317,13 +317,15 @@ static void
draw_unfocused_block(const struct terminal *term, pixman_image_t *pix, draw_unfocused_block(const struct terminal *term, pixman_image_t *pix,
const pixman_color_t *color, int x, int y, int cell_cols) const pixman_color_t *color, int x, int y, int cell_cols)
{ {
const int scale = term->scale;
pixman_image_fill_rectangles( pixman_image_fill_rectangles(
PIXMAN_OP_SRC, pix, color, 4, PIXMAN_OP_SRC, pix, color, 4,
(pixman_rectangle16_t []){ (pixman_rectangle16_t []){
{x, y, cell_cols * term->cell_width, 1}, /* top */ {x, y, cell_cols * term->cell_width, scale}, /* top */
{x, y, 1, term->cell_height}, /* left */ {x, y, scale, term->cell_height}, /* left */
{x + cell_cols * term->cell_width - 1, y, 1, term->cell_height}, /* right */ {x + cell_cols * term->cell_width - scale, y, scale, term->cell_height}, /* right */
{x, y + term->cell_height - 1, cell_cols * term->cell_width, 1}, /* bottom */ {x, y + term->cell_height - scale, cell_cols * term->cell_width, scale}, /* bottom */
}); });
} }