Fix software cursors on scaled outputs

There was an issue where it would only work within the boundaries of the
unscaled resolution.
This commit is contained in:
Drew DeVault 2017-11-04 11:47:34 -04:00
parent 6d8e1abfc0
commit 2f6cfe4057
2 changed files with 3 additions and 2 deletions

View file

@ -249,7 +249,7 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *_backend) {
wlr_output_init(&output->wlr_output, &backend->backend, &output_impl);
struct wlr_output *wlr_output = &output->wlr_output;
wlr_output_update_size(wlr_output, 640, 480);
wlr_output_update_size(wlr_output, 1280, 720);
strncpy(wlr_output->make, "wayland", sizeof(wlr_output->make));
strncpy(wlr_output->model, "wayland", sizeof(wlr_output->model));
snprintf(wlr_output->name, sizeof(wlr_output->name), "WL-%d",

View file

@ -270,6 +270,8 @@ static void output_cursor_render(struct wlr_output_cursor *cursor) {
output_box.x = output_box.y = 0;
wlr_output_effective_resolution(cursor->output, &output_box.width,
&output_box.height);
output_box.width *= cursor->output->scale;
output_box.height *= cursor->output->scale;
struct wlr_box cursor_box;
output_cursor_get_box(cursor, &cursor_box);
@ -476,7 +478,6 @@ bool wlr_output_cursor_move(struct wlr_output_cursor *cursor,
double x, double y) {
x *= cursor->output->scale;
y *= cursor->output->scale;
wlr_log(L_DEBUG, "Moving cursor to %f,%f", x, y);
cursor->x = x;
cursor->y = y;