diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-30 18:53:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-30 18:53:36 -0400 |
commit | 1b88eaee6b14987c585fcf149cc26f665c584d77 (patch) | |
tree | 047052218c4f19701f29c4e5547856f445670c5b /sway/desktop/xwayland.c | |
parent | e6fa7a722e9329b1e61ff2977ae715da3c2d9c9b (diff) | |
parent | 139f80b0f03cd772e408604203df81f285ca3f67 (diff) |
Merge pull request #1665 from emersion/damage-tracking-lite
Add lite damage tracking
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index dfc54e86..01c993b3 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -14,10 +14,10 @@ #include "sway/input/input-manager.h" #include "log.h" - static bool assert_xwayland(struct sway_view *view) { - return sway_assert(view->type == SWAY_XWAYLAND_VIEW && view->wlr_xwayland_surface, - "Expected xwayland view!"); - } +static bool assert_xwayland(struct sway_view *view) { + return sway_assert(view->type == SWAY_XWAYLAND_VIEW, + "Expected xwayland view!"); +} static const char *get_prop(struct sway_view *view, enum sway_view_prop prop) { if (!assert_xwayland(view)) { @@ -99,6 +99,7 @@ static void handle_commit(struct wl_listener *listener, void *data) { // TODO: Let floating views do whatever view->width = sway_surface->pending_width; view->height = sway_surface->pending_height; + view_damage_from(view); } static void handle_destroy(struct wl_listener *listener, void *data) { @@ -117,7 +118,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { static void handle_unmap(struct wl_listener *listener, void *data) { struct sway_xwayland_surface *sway_surface = wl_container_of(listener, sway_surface, unmap); - + view_damage_whole(sway_surface->view); wl_list_remove(&sway_surface->view->unmanaged_view_link); wl_list_init(&sway_surface->view->unmanaged_view_link); container_view_destroy(sway_surface->view->swayc); @@ -126,7 +127,6 @@ static void handle_unmap(struct wl_listener *listener, void *data) { } static void handle_map(struct wl_listener *listener, void *data) { - // TODO put the view back into the tree struct sway_xwayland_surface *sway_surface = wl_container_of(listener, sway_surface, map); struct wlr_xwayland_surface *xsurface = data; @@ -150,6 +150,8 @@ static void handle_map(struct wl_listener *listener, void *data) { arrange_windows(cont->parent, -1, -1); sway_input_manager_set_focus(input_manager, cont); } + + view_damage_whole(sway_surface->view); } static void handle_configure_request(struct wl_listener *listener, void *data) { @@ -190,7 +192,6 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { sway_view->iface.close = close_view; sway_view->wlr_xwayland_surface = xsurface; sway_view->sway_xwayland_surface = sway_surface; - sway_view->surface = xsurface->surface; sway_surface->view = sway_view; wl_list_init(&sway_view->unmanaged_view_link); |