aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-22 23:19:21 -0400
committerDrew DeVault <sir@cmpwn.com>2017-11-01 08:44:07 -0400
commita7446792a1a0fd9fe3391f041d7bbfe9e2b11255 (patch)
treed07f4baaaf9fb38ba68c0f932a39b738bc570d1d /rootston
parent03c0d41ca956e3eb5ddac15a34918bfb97fc4c09 (diff)
Consider scale factor when rendering views
Diffstat (limited to 'rootston')
-rw-r--r--rootston/config.c4
-rw-r--r--rootston/output.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/rootston/config.c b/rootston/config.c
index 18138ab0..983117ba 100644
--- a/rootston/config.c
+++ b/rootston/config.c
@@ -220,6 +220,7 @@ static int config_ini_handler(void *user, const char *section, const char *name,
oc = calloc(1, sizeof(struct output_config));
oc->name = strdup(output_name);
oc->transform = WL_OUTPUT_TRANSFORM_NORMAL;
+ oc->scale = 1;
wl_list_insert(&config->outputs, &oc->link);
}
@@ -227,6 +228,9 @@ static int config_ini_handler(void *user, const char *section, const char *name,
oc->x = strtol(value, NULL, 10);
} else if (strcmp(name, "y") == 0) {
oc->y = strtol(value, NULL, 10);
+ } else if (strcmp(name, "scale") == 0) {
+ oc->scale = strtol(value, NULL, 10);
+ assert(oc->scale >= 1);
} else if (strcmp(name, "rotate") == 0) {
if (strcmp(value, "90") == 0) {
oc->transform = WL_OUTPUT_TRANSFORM_90;
diff --git a/rootston/output.c b/rootston/output.c
index baa7b6cc..faf39e74 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -27,6 +27,8 @@ static void render_surface(struct wlr_surface *surface,
if (wlr_output_layout_intersects(desktop->layout, wlr_output,
lx, ly, lx + width, ly + height)) {
+ // TODO: accomodate for mismatched scale, which can happen, for
+ // example, when a view is rendered over two outputs
float matrix[16];
float translate_origin[16];
@@ -217,6 +219,7 @@ void output_add_notify(struct wl_listener *listener, void *data) {
if (output_config->mode.width) {
set_mode(wlr_output, output_config);
}
+ wlr_output->scale = output_config->scale;
wlr_output_transform(wlr_output, output_config->transform);
wlr_output_layout_add(desktop->layout,
wlr_output, output_config->x, output_config->y);