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

@ -1036,6 +1036,16 @@ entry(xmlNode *node, char *nodename, char *content)
}
} else if (!strcasecmp(nodename, "ignoreButtonReleasePeriod.menu")) {
rc.menu_ignore_button_release_period = atoi(content);
} else if (!strcasecmp(nodename, "width.magnifier")) {
rc.mag_width = atoi(content);
} else if (!strcasecmp(nodename, "height.magnifier")) {
rc.mag_height = atoi(content);
} else if (!strcasecmp(nodename, "initScale.magnifier")) {
set_float(content, &rc.mag_scale);
} else if (!strcasecmp(nodename, "increment.magnifier")) {
set_float(content, &rc.mag_increment);
} else if (!strcasecmp(nodename, "useFilter.magnifier")) {
set_bool(content, &rc.mag_filter);
}
}
@ -1242,6 +1252,12 @@ rcxml_init(void)
rc.workspace_config.min_nr_workspaces = 1;
rc.menu_ignore_button_release_period = 250;
rc.mag_width = 400;
rc.mag_height = 400;
rc.mag_scale = 2.0;
rc.mag_increment = 0.2;
rc.mag_filter = true;
}
static void
@ -1468,6 +1484,10 @@ post_processing(void)
wlr_log(WLR_INFO, "load default window switcher fields");
load_default_window_switcher_fields();
}
if (rc.mag_scale <= 0.0) {
rc.mag_scale = 1.0;
}
}
static void