aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c3
-rw-r--r--backend/drm/util.c2
-rw-r--r--backend/libinput/backend.c2
-rw-r--r--backend/wayland/wl_seat.c18
-rw-r--r--backend/x11/input_device.c14
5 files changed, 8 insertions, 31 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 70089e06..e8ed7316 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -32,7 +32,8 @@ bool check_drm_features(struct wlr_drm_backend *drm) {
return false;
}
- if (getenv("WLR_DRM_NO_ATOMIC")) {
+ const char *no_atomic = getenv("WLR_DRM_NO_ATOMIC");
+ if (no_atomic && strcmp(no_atomic, "1") == 0) {
wlr_log(L_DEBUG, "WLR_DRM_NO_ATOMIC set, forcing legacy DRM interface");
drm->iface = &legacy_iface;
} else if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_ATOMIC, 1)) {
diff --git a/backend/drm/util.c b/backend/drm/util.c
index 41ba47d1..73669205 100644
--- a/backend/drm/util.c
+++ b/backend/drm/util.c
@@ -266,7 +266,7 @@ static bool match_obj_(struct match_state *st, size_t skips, size_t score, size_
continue;
}
- // Not compatable
+ // Not compatible
if (!(st->objs[st->res[i]] & (1 << i))) {
continue;
}
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c
index 4fcd2fe4..f4d54c97 100644
--- a/backend/libinput/backend.c
+++ b/backend/libinput/backend.c
@@ -92,7 +92,7 @@ static bool backend_start(struct wlr_backend *_backend) {
wlr_log(L_ERROR, "Failed to create input event on event loop");
return false;
}
- wlr_log(L_DEBUG, "libinput sucessfully initialized");
+ wlr_log(L_DEBUG, "libinput successfully initialized");
return true;
}
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 454a2bb0..8191cb80 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -74,25 +74,11 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
}
struct wlr_output *wlr_output = &pointer->output->wlr_output;
-
- struct wlr_box box = {
- .x = wl_fixed_to_int(sx),
- .y = wl_fixed_to_int(sy),
- };
- wlr_box_transform(&box, wlr_output->transform, wlr_output->width,
- wlr_output->height, &box);
- box.x /= wlr_output->scale;
- box.y /= wlr_output->scale;
-
- int output_width, output_height;
- wlr_output_effective_resolution(&pointer->output->wlr_output,
- &output_width, &output_height);
-
struct wlr_event_pointer_motion_absolute event = {
.device = &pointer->input_device->wlr_input_device,
.time_msec = time,
- .x = (double)box.x / output_width,
- .y = (double)box.y / output_height,
+ .x = wl_fixed_to_double(sx) / wlr_output->width,
+ .y = wl_fixed_to_double(sy) / wlr_output->height,
};
wlr_signal_emit_safe(&pointer->wlr_pointer.events.motion_absolute, &event);
}
diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c
index f8b87630..75cfa76e 100644
--- a/backend/x11/input_device.c
+++ b/backend/x11/input_device.c
@@ -32,21 +32,11 @@ static void x11_handle_pointer_position(struct wlr_x11_output *output,
int16_t x, int16_t y, xcb_timestamp_t time) {
struct wlr_x11_backend *x11 = output->x11;
struct wlr_output *wlr_output = &output->wlr_output;
-
- struct wlr_box box = { .x = x, .y = y };
- wlr_box_transform(&box, wlr_output->transform, wlr_output->width,
- wlr_output->height, &box);
- box.x /= wlr_output->scale;
- box.y /= wlr_output->scale;
-
- int output_width, output_height;
- wlr_output_effective_resolution(wlr_output, &output_width, &output_height);
-
struct wlr_event_pointer_motion_absolute event = {
.device = &output->pointer_dev,
.time_msec = time,
- .x = (double)box.x / output_width,
- .y = (double)box.y / output_height,
+ .x = (double)x / wlr_output->width,
+ .y = (double)y / wlr_output->height,
};
wlr_signal_emit_safe(&output->pointer.events.motion_absolute, &event);