aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-11-04 11:47:34 -0400
committerDrew DeVault <sir@cmpwn.com>2017-11-04 11:47:34 -0400
commit2f6cfe4057fbef41977159e24fea0d19fbeeb052 (patch)
treef73eb0d23e691bf31f899439ded89857a369d01c
parent6d8e1abfc0a266e8ff1a8c9ba1a004faeaac79d5 (diff)
Fix software cursors on scaled outputs
There was an issue where it would only work within the boundaries of the unscaled resolution.
-rw-r--r--backend/wayland/output.c2
-rw-r--r--types/wlr_output.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index 90f8b39a..c4301617 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -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",
diff --git a/types/wlr_output.c b/types/wlr_output.c
index 3ad69ce3..df02afec 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -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;