rootston: damage tracking for drag icons

This commit is contained in:
emersion 2018-01-23 13:37:58 +01:00
parent 415a2b7c56
commit 2ad7df8680
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
9 changed files with 142 additions and 31 deletions

View file

@ -406,29 +406,15 @@ static void render_output(struct roots_output *output) {
}
// Render drag icons
struct wlr_drag_icon *drag_icon = NULL;
struct roots_drag_icon *drag_icon = NULL;
struct roots_seat *seat = NULL;
wl_list_for_each(seat, &server->input->seats, link) {
wl_list_for_each(drag_icon, &seat->seat->drag_icons, link) {
if (!drag_icon->mapped) {
wl_list_for_each(drag_icon, &seat->drag_icons, link) {
if (!drag_icon->wlr_drag_icon->mapped) {
continue;
}
struct wlr_surface *icon = drag_icon->surface;
struct wlr_cursor *cursor = seat->cursor->cursor;
double icon_x = 0, icon_y = 0;
if (drag_icon->is_pointer) {
icon_x = cursor->x + drag_icon->sx;
icon_y = cursor->y + drag_icon->sy;
render_surface(icon, icon_x, icon_y, 0, &data);
} else {
struct wlr_touch_point *point =
wlr_seat_touch_get_point(seat->seat, drag_icon->touch_id);
if (point) {
icon_x = seat->touch_x + drag_icon->sx;
icon_y = seat->touch_y + drag_icon->sy;
render_surface(icon, icon_x, icon_y, 0, &data);
}
}
render_surface(drag_icon->wlr_drag_icon->surface,
drag_icon->x, drag_icon->y, 0, &data);
}
}
@ -528,6 +514,12 @@ void output_damage_whole_view(struct roots_output *output,
view_for_each_surface(view, damage_whole_surface, output);
}
void output_damage_whole_drag_icon(struct roots_output *output,
struct roots_drag_icon *icon) {
surface_for_each_surface(icon->wlr_drag_icon->surface, icon->x, icon->y, 0,
damage_whole_surface, output);
}
static void damage_from_surface(struct wlr_surface *surface,
double lx, double ly, float rotation, void *data) {
struct roots_output *output = data;