diff options
author | emersion <contact@emersion.fr> | 2018-06-07 11:18:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 11:18:58 +0100 |
commit | 6f895081e1d05e651543187e11766259e2b4f798 (patch) | |
tree | 9ef3692165726c41d7ad3d39dc8880eda21ea0f8 /rootston | |
parent | 211463ba8709e1ac94944deb11b5669f2d3b32e4 (diff) | |
parent | 5d3e95f833ae562bf6926ddfb9f1bdb0492c1674 (diff) | |
download | wlroots-6f895081e1d05e651543187e11766259e2b4f798.tar.xz |
Merge pull request #1043 from acrisci/drag-icon-unmap
drag-icon map and unmap fixes
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/seat.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/rootston/seat.c b/rootston/seat.c index b137ff11..91561567 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -260,7 +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_damage_whole(icon); + roots_drag_icon_update_position(icon); } static void roots_drag_icon_handle_map(struct wl_listener *listener, @@ -270,6 +270,13 @@ static void roots_drag_icon_handle_map(struct wl_listener *listener, roots_drag_icon_damage_whole(icon); } +static void roots_drag_icon_handle_unmap(struct wl_listener *listener, + void *data) { + struct roots_drag_icon *icon = + wl_container_of(listener, icon, unmap); + roots_drag_icon_damage_whole(icon); +} + static void roots_drag_icon_handle_destroy(struct wl_listener *listener, void *data) { struct roots_drag_icon *icon = @@ -278,7 +285,7 @@ static void roots_drag_icon_handle_destroy(struct wl_listener *listener, wl_list_remove(&icon->link); wl_list_remove(&icon->surface_commit.link); - wl_list_remove(&icon->map.link); + wl_list_remove(&icon->unmap.link); wl_list_remove(&icon->destroy.link); free(icon); } @@ -297,12 +304,16 @@ static void roots_seat_handle_new_drag_icon(struct wl_listener *listener, icon->surface_commit.notify = roots_drag_icon_handle_surface_commit; wl_signal_add(&wlr_drag_icon->surface->events.commit, &icon->surface_commit); + icon->unmap.notify = roots_drag_icon_handle_unmap; + wl_signal_add(&wlr_drag_icon->events.unmap, &icon->unmap); icon->map.notify = roots_drag_icon_handle_map; wl_signal_add(&wlr_drag_icon->events.map, &icon->map); icon->destroy.notify = roots_drag_icon_handle_destroy; 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) { |