Add screen magnifier

This adds a screen magnifier which can be controlled with the
`ZoomIn` / `ZoomOut` and `ToggleMagnify` actions.

It scales up part of the rendered framebuffer so the magnification
may end up looking blurry depending on the magnification scale.

PR #1774
This commit is contained in:
Simon Long 2024-05-15 23:07:23 +01:00 committed by GitHub
parent ad15c0474d
commit 8ba066a1a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 473 additions and 1 deletions

View file

@ -571,6 +571,10 @@ theme_builtin(struct theme *theme, struct server *server)
memset(theme->snapping_overlay_edge.border_color, 0,
sizeof(theme->snapping_overlay_edge.border_color));
theme->snapping_overlay_edge.border_color[0][0] = FLT_MIN;
/* magnifier */
parse_hexstr("#ff0000", theme->mag_border_color);
theme->mag_border_width = 1;
}
static void
@ -826,6 +830,13 @@ entry(struct theme *theme, const char *key, const char *value)
if (match_glob(key, "snapping.overlay.edge.border.color")) {
parse_hexstrs(value, theme->snapping_overlay_edge.border_color);
}
if (match_glob(key, "magnifier.border.width")) {
theme->mag_border_width = atoi(value);
}
if (match_glob(key, "magnifier.border.color")) {
parse_hexstr(value, theme->mag_border_color);
}
}
static void