diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-07 11:53:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-07 11:53:10 -0400 |
commit | c47b4d4edb7714612ec7236fafda5ca54cb92ce4 (patch) | |
tree | 9a7f991e9c3da20351b58c53e0b6dbe376f12dca /sway/desktop/xdg_shell_v6.c | |
parent | f5a9bd5cb75b37376b98eadbff2facb7e0021d57 (diff) | |
parent | 0c627918bb1d4c056744157b8c37fb1f62c5ca8e (diff) | |
download | sway-c47b4d4edb7714612ec7236fafda5ca54cb92ce4.tar.xz |
Merge pull request #1756 from emersion/output-damage
Fine-grained damage tracking
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 8361aab3..e4703040 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c @@ -143,9 +143,7 @@ static void destroy(struct sway_view *view) { if (xdg_shell_v6_view == NULL) { return; } - wl_list_remove(&xdg_shell_v6_view->commit.link); wl_list_remove(&xdg_shell_v6_view->destroy.link); - wl_list_remove(&xdg_shell_v6_view->new_popup.link); wl_list_remove(&xdg_shell_v6_view->map.link); wl_list_remove(&xdg_shell_v6_view->unmap.link); free(xdg_shell_v6_view); @@ -169,7 +167,7 @@ static void handle_commit(struct wl_listener *listener, void *data) { // TODO: Let floating views do whatever view_update_size(view, xdg_shell_v6_view->pending_width, xdg_shell_v6_view->pending_height); - view_damage_from(view); + view_damage(view, false); } static void handle_new_popup(struct wl_listener *listener, void *data) { @@ -182,14 +180,28 @@ static void handle_new_popup(struct wl_listener *listener, void *data) { static void handle_unmap(struct wl_listener *listener, void *data) { struct sway_xdg_shell_v6_view *xdg_shell_v6_view = wl_container_of(listener, xdg_shell_v6_view, unmap); + view_unmap(&xdg_shell_v6_view->view); + + wl_list_remove(&xdg_shell_v6_view->commit.link); + wl_list_remove(&xdg_shell_v6_view->new_popup.link); } static void handle_map(struct wl_listener *listener, void *data) { struct sway_xdg_shell_v6_view *xdg_shell_v6_view = wl_container_of(listener, xdg_shell_v6_view, map); struct sway_view *view = &xdg_shell_v6_view->view; + struct wlr_xdg_surface_v6 *xdg_surface = view->wlr_xdg_surface_v6; + view_map(view, view->wlr_xdg_surface_v6->surface); + + xdg_shell_v6_view->commit.notify = handle_commit; + wl_signal_add(&xdg_surface->surface->events.commit, + &xdg_shell_v6_view->commit); + + xdg_shell_v6_view->new_popup.notify = handle_new_popup; + wl_signal_add(&xdg_surface->events.new_popup, + &xdg_shell_v6_view->new_popup); } static void handle_destroy(struct wl_listener *listener, void *data) { @@ -226,14 +238,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { // - Look up pid and open on appropriate workspace // - Criteria - xdg_shell_v6_view->commit.notify = handle_commit; - wl_signal_add(&xdg_surface->surface->events.commit, - &xdg_shell_v6_view->commit); - - xdg_shell_v6_view->new_popup.notify = handle_new_popup; - wl_signal_add(&xdg_surface->events.new_popup, - &xdg_shell_v6_view->new_popup); - xdg_shell_v6_view->map.notify = handle_map; wl_signal_add(&xdg_surface->events.map, &xdg_shell_v6_view->map); |