diff options
author | emersion <contact@emersion.fr> | 2018-04-05 18:48:35 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-04-05 18:48:35 -0400 |
commit | 641807d920854fdecc1307bd809c198db1a7dff1 (patch) | |
tree | a275dc0046e90f7b2eb4ee3195e9f44976757165 /sway/desktop/xwayland.c | |
parent | Fix desktop_damage_whole_surface (diff) | |
download | sway-641807d920854fdecc1307bd809c198db1a7dff1.tar.gz sway-641807d920854fdecc1307bd809c198db1a7dff1.tar.zst sway-641807d920854fdecc1307bd809c198db1a7dff1.zip |
Handle unmanaged surfaces motion
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 4797b801..e3da1da7 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -29,19 +29,35 @@ static void unmanaged_handle_commit(struct wl_listener *listener, void *data) { | |||
29 | struct sway_xwayland_unmanaged *surface = | 29 | struct sway_xwayland_unmanaged *surface = |
30 | wl_container_of(listener, surface, commit); | 30 | wl_container_of(listener, surface, commit); |
31 | struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface; | 31 | struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface; |
32 | desktop_damage_from_surface(xsurface->surface, xsurface->x, xsurface->y); | 32 | |
33 | // TODO: handle window motion | 33 | if (xsurface->x != surface->lx || xsurface->y != surface->ly) { |
34 | // Surface has moved | ||
35 | desktop_damage_whole_surface(xsurface->surface, | ||
36 | surface->lx, surface->ly); | ||
37 | surface->lx = xsurface->x; | ||
38 | surface->ly = xsurface->y; | ||
39 | desktop_damage_whole_surface(xsurface->surface, | ||
40 | surface->lx, surface->ly); | ||
41 | } else { | ||
42 | desktop_damage_from_surface(xsurface->surface, | ||
43 | xsurface->x, xsurface->y); | ||
44 | } | ||
34 | } | 45 | } |
35 | 46 | ||
36 | static void unmanaged_handle_map(struct wl_listener *listener, void *data) { | 47 | static void unmanaged_handle_map(struct wl_listener *listener, void *data) { |
37 | struct sway_xwayland_unmanaged *surface = | 48 | struct sway_xwayland_unmanaged *surface = |
38 | wl_container_of(listener, surface, map); | 49 | wl_container_of(listener, surface, map); |
39 | struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface; | 50 | struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface; |
51 | |||
40 | wl_list_insert(&root_container.sway_root->xwayland_unmanaged, | 52 | wl_list_insert(&root_container.sway_root->xwayland_unmanaged, |
41 | &surface->link); | 53 | &surface->link); |
54 | |||
42 | wl_signal_add(&xsurface->surface->events.commit, &surface->commit); | 55 | wl_signal_add(&xsurface->surface->events.commit, &surface->commit); |
43 | surface->commit.notify = unmanaged_handle_commit; | 56 | surface->commit.notify = unmanaged_handle_commit; |
44 | desktop_damage_whole_surface(xsurface->surface, xsurface->x, xsurface->y); | 57 | |
58 | surface->lx = xsurface->x; | ||
59 | surface->ly = xsurface->y; | ||
60 | desktop_damage_whole_surface(xsurface->surface, surface->lx, surface->ly); | ||
45 | } | 61 | } |
46 | 62 | ||
47 | static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { | 63 | static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { |