aboutsummaryrefslogtreecommitdiff
path: root/rootston/output.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-23 13:37:58 +0100
committeremersion <contact@emersion.fr>2018-01-23 20:01:40 +0100
commit2ad7df868097d557ed3cc41dfa60e0637f8a08e8 (patch)
tree783b97e6793e7ed1d88f786b582a45492b3b6bee /rootston/output.c
parent415a2b7c569457ebf85d7ae066cc19bee196d22e (diff)
rootston: damage tracking for drag icons
Diffstat (limited to 'rootston/output.c')
-rw-r--r--rootston/output.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/rootston/output.c b/rootston/output.c
index b6879965..1b2a17d8 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -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;