mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-06 13:29:45 -05:00
Add wlr_output_cursor
This commit is contained in:
parent
e9c2cf09dc
commit
1b6c729360
5 changed files with 287 additions and 258 deletions
|
|
@ -558,36 +558,37 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
|
|||
}
|
||||
}
|
||||
|
||||
switch (output->transform) {
|
||||
case WL_OUTPUT_TRANSFORM_90:
|
||||
output->cursor.hotspot_x = hotspot_x;
|
||||
output->cursor.hotspot_y = -plane->surf.height + hotspot_y;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_180:
|
||||
output->cursor.hotspot_x = plane->surf.width - hotspot_x;
|
||||
output->cursor.hotspot_y = plane->surf.height - hotspot_y;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_270:
|
||||
output->cursor.hotspot_x = -plane->surf.height + hotspot_x;
|
||||
output->cursor.hotspot_y = hotspot_y;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED:
|
||||
output->cursor.hotspot_x = plane->surf.width - hotspot_x;
|
||||
output->cursor.hotspot_y = hotspot_y;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
|
||||
output->cursor.hotspot_x = hotspot_x;
|
||||
output->cursor.hotspot_y = -hotspot_y;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
|
||||
output->cursor.hotspot_x = hotspot_x;
|
||||
output->cursor.hotspot_y = plane->surf.height - hotspot_y;
|
||||
break;
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
|
||||
output->cursor.hotspot_x = -plane->surf.height + hotspot_x;
|
||||
output->cursor.hotspot_y = plane->surf.width - hotspot_y;
|
||||
break;
|
||||
}
|
||||
// TODO: this doesn't belong here
|
||||
// switch (output->transform) {
|
||||
// case WL_OUTPUT_TRANSFORM_90:
|
||||
// output->cursor.hotspot_x = hotspot_x;
|
||||
// output->cursor.hotspot_y = -plane->surf.height + hotspot_y;
|
||||
// break;
|
||||
// case WL_OUTPUT_TRANSFORM_180:
|
||||
// output->cursor.hotspot_x = plane->surf.width - hotspot_x;
|
||||
// output->cursor.hotspot_y = plane->surf.height - hotspot_y;
|
||||
// break;
|
||||
// case WL_OUTPUT_TRANSFORM_270:
|
||||
// output->cursor.hotspot_x = -plane->surf.height + hotspot_x;
|
||||
// output->cursor.hotspot_y = hotspot_y;
|
||||
// break;
|
||||
// case WL_OUTPUT_TRANSFORM_FLIPPED:
|
||||
// output->cursor.hotspot_x = plane->surf.width - hotspot_x;
|
||||
// output->cursor.hotspot_y = hotspot_y;
|
||||
// break;
|
||||
// case WL_OUTPUT_TRANSFORM_FLIPPED_90:
|
||||
// output->cursor.hotspot_x = hotspot_x;
|
||||
// output->cursor.hotspot_y = -hotspot_y;
|
||||
// break;
|
||||
// case WL_OUTPUT_TRANSFORM_FLIPPED_180:
|
||||
// output->cursor.hotspot_x = hotspot_x;
|
||||
// output->cursor.hotspot_y = plane->surf.height - hotspot_y;
|
||||
// break;
|
||||
// case WL_OUTPUT_TRANSFORM_FLIPPED_270:
|
||||
// output->cursor.hotspot_x = -plane->surf.height + hotspot_x;
|
||||
// output->cursor.hotspot_y = plane->surf.width - hotspot_y;
|
||||
// break;
|
||||
// }
|
||||
|
||||
if (!update_pixels) {
|
||||
// Only update the cursor hotspot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue