mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Damage tracking for transformed outputs
This commit is contained in:
parent
a98ece68d3
commit
ece2c1e4e2
12 changed files with 185 additions and 154 deletions
|
|
@ -581,15 +581,14 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
|
|||
}
|
||||
|
||||
struct wlr_box hotspot = {
|
||||
.width = plane->surf.width,
|
||||
.height = plane->surf.height,
|
||||
.x = hotspot_x,
|
||||
.y = hotspot_y,
|
||||
};
|
||||
enum wl_output_transform transform =
|
||||
wlr_output_transform_invert(output->transform);
|
||||
struct wlr_box transformed_hotspot;
|
||||
wlr_box_transform(&hotspot, transform, &transformed_hotspot);
|
||||
wlr_box_transform(&hotspot, transform,
|
||||
plane->surf.width, plane->surf.height, &transformed_hotspot);
|
||||
plane->cursor_hotspot_x = transformed_hotspot.x;
|
||||
plane->cursor_hotspot_y = transformed_hotspot.y;
|
||||
|
||||
|
|
@ -650,15 +649,15 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output,
|
|||
}
|
||||
struct wlr_drm_plane *plane = conn->crtc->cursor;
|
||||
|
||||
struct wlr_box box;
|
||||
box.x = x;
|
||||
box.y = y;
|
||||
wlr_output_effective_resolution(output, &box.width, &box.height);
|
||||
struct wlr_box box = { .x = x, .y = y };
|
||||
|
||||
int width, height;
|
||||
wlr_output_effective_resolution(output, &width, &height);
|
||||
|
||||
enum wl_output_transform transform =
|
||||
wlr_output_transform_invert(output->transform);
|
||||
struct wlr_box transformed_box;
|
||||
wlr_box_transform(&box, transform, &transformed_box);
|
||||
wlr_box_transform(&box, transform, width, height, &transformed_box);
|
||||
|
||||
if (plane != NULL) {
|
||||
transformed_box.x -= plane->cursor_hotspot_x;
|
||||
|
|
|
|||
|
|
@ -54,14 +54,16 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
|||
|
||||
struct wlr_output *wlr_output = &wlr_wl_pointer->current_output->wlr_output;
|
||||
|
||||
struct wlr_box box;
|
||||
int width, height;
|
||||
wl_egl_window_get_attached_size(wlr_wl_pointer->current_output->egl_window,
|
||||
&box.width, &box.height);
|
||||
box.x = wl_fixed_to_int(surface_x);
|
||||
box.y = wl_fixed_to_int(surface_y);
|
||||
&width, &height);
|
||||
|
||||
struct wlr_box box = {
|
||||
.x = wl_fixed_to_int(surface_x),
|
||||
.y = wl_fixed_to_int(surface_y),
|
||||
};
|
||||
struct wlr_box transformed;
|
||||
wlr_box_transform(&box, wlr_output->transform, &transformed);
|
||||
wlr_box_transform(&box, wlr_output->transform, width, height, &transformed);
|
||||
transformed.x /= wlr_output->scale;
|
||||
transformed.y /= wlr_output->scale;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue