aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-06-05 23:45:03 -0400
committerTony Crisci <tony@dubstepdish.com>2018-06-05 23:45:03 -0400
commit7c888a39c6d08e9301032625987a6015fac17c6f (patch)
treedfc7ca93bc4b37cb050fc876d44ecfb010876c40
parent9333acd68e468d409cbcc30fb742fdf57c631cb9 (diff)
update drag position at the right times
-rw-r--r--rootston/seat.c3
-rw-r--r--types/data_device/wlr_drag.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/rootston/seat.c b/rootston/seat.c
index 132b0f35..33dff741 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -260,6 +260,7 @@ static void roots_drag_icon_handle_surface_commit(struct wl_listener *listener,
void *data) {
struct roots_drag_icon *icon =
wl_container_of(listener, icon, surface_commit);
+ roots_drag_icon_update_position(icon);
roots_drag_icon_damage_whole(icon);
}
@@ -312,6 +313,8 @@ static void roots_seat_handle_new_drag_icon(struct wl_listener *listener,
wl_signal_add(&wlr_drag_icon->events.destroy, &icon->destroy);
wl_list_insert(&seat->drag_icons, &icon->link);
+
+ roots_drag_icon_update_position(icon);
}
void roots_drag_icon_update_position(struct roots_drag_icon *icon) {
diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c
index 4b42307e..4f0b2521 100644
--- a/types/data_device/wlr_drag.c
+++ b/types/data_device/wlr_drag.c
@@ -100,12 +100,12 @@ static void drag_set_focus(struct wlr_drag *drag,
static void drag_icon_set_mapped(struct wlr_drag_icon *icon, bool mapped) {
if (mapped && !icon->mapped) {
+ icon->mapped = true;
wlr_signal_emit_safe(&icon->events.map, icon);
} else if (!mapped && icon->mapped) {
+ icon->mapped = false;
wlr_signal_emit_safe(&icon->events.unmap, icon);
}
-
- icon->mapped = mapped;
}
static void drag_end(struct wlr_drag *drag) {