aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sway/tree/view.h1
-rw-r--r--sway/desktop/xwayland.c17
2 files changed, 14 insertions, 4 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 9fe710d7..dac348ee 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -174,6 +174,7 @@ struct sway_xwayland_unmanaged {
174 struct wl_listener request_configure; 174 struct wl_listener request_configure;
175 struct wl_listener request_fullscreen; 175 struct wl_listener request_fullscreen;
176 struct wl_listener commit; 176 struct wl_listener commit;
177 struct wl_listener set_geometry;
177 struct wl_listener map; 178 struct wl_listener map;
178 struct wl_listener unmap; 179 struct wl_listener unmap;
179 struct wl_listener destroy; 180 struct wl_listener destroy;
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index e35473bf..cee0ab10 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -47,6 +47,15 @@ static void unmanaged_handle_commit(struct wl_listener *listener, void *data) {
47 wl_container_of(listener, surface, commit); 47 wl_container_of(listener, surface, commit);
48 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface; 48 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
49 49
50 desktop_damage_surface(xsurface->surface, surface->lx, surface->ly,
51 false);
52}
53
54static void unmanaged_handle_set_geometry(struct wl_listener *listener, void *data) {
55 struct sway_xwayland_unmanaged *surface =
56 wl_container_of(listener, surface, set_geometry);
57 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
58
50 if (xsurface->x != surface->lx || xsurface->y != surface->ly) { 59 if (xsurface->x != surface->lx || xsurface->y != surface->ly) {
51 // Surface has moved 60 // Surface has moved
52 desktop_damage_surface(xsurface->surface, surface->lx, surface->ly, 61 desktop_damage_surface(xsurface->surface, surface->lx, surface->ly,
@@ -55,9 +64,6 @@ static void unmanaged_handle_commit(struct wl_listener *listener, void *data) {
55 surface->ly = xsurface->y; 64 surface->ly = xsurface->y;
56 desktop_damage_surface(xsurface->surface, surface->lx, surface->ly, 65 desktop_damage_surface(xsurface->surface, surface->lx, surface->ly,
57 true); 66 true);
58 } else {
59 desktop_damage_surface(xsurface->surface, xsurface->x, xsurface->y,
60 false);
61 } 67 }
62} 68}
63 69
@@ -68,6 +74,9 @@ static void unmanaged_handle_map(struct wl_listener *listener, void *data) {
68 74
69 wl_list_insert(root->xwayland_unmanaged.prev, &surface->link); 75 wl_list_insert(root->xwayland_unmanaged.prev, &surface->link);
70 76
77 wl_signal_add(&xsurface->events.set_geometry, &surface->set_geometry);
78 surface->set_geometry.notify = unmanaged_handle_set_geometry;
79
71 wl_signal_add(&xsurface->surface->events.commit, &surface->commit); 80 wl_signal_add(&xsurface->surface->events.commit, &surface->commit);
72 surface->commit.notify = unmanaged_handle_commit; 81 surface->commit.notify = unmanaged_handle_commit;
73 82
@@ -89,6 +98,7 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
89 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface; 98 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
90 desktop_damage_surface(xsurface->surface, xsurface->x, xsurface->y, true); 99 desktop_damage_surface(xsurface->surface, xsurface->x, xsurface->y, true);
91 wl_list_remove(&surface->link); 100 wl_list_remove(&surface->link);
101 wl_list_remove(&surface->set_geometry.link);
92 wl_list_remove(&surface->commit.link); 102 wl_list_remove(&surface->commit.link);
93 103
94 struct sway_seat *seat = input_manager_current_seat(); 104 struct sway_seat *seat = input_manager_current_seat();
@@ -174,7 +184,6 @@ static struct sway_xwayland_unmanaged *create_unmanaged(
174 return surface; 184 return surface;
175} 185}
176 186
177
178static struct sway_xwayland_view *xwayland_view_from_view( 187static struct sway_xwayland_view *xwayland_view_from_view(
179 struct sway_view *view) { 188 struct sway_view *view) {
180 if (!sway_assert(view->type == SWAY_VIEW_XWAYLAND, 189 if (!sway_assert(view->type == SWAY_VIEW_XWAYLAND,