diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-03 13:03:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 13:03:06 +0200 |
commit | 06c214a800cab9119ae4b04371e3f6bbca8a0550 (patch) | |
tree | eed325e37d02fa71858a33e71ef33961395dd16f /sway/desktop/xwayland.c | |
parent | Merge pull request #2755 from RyanDwyer/fix-tiling-criteria (diff) | |
parent | Remove server-decoration assumption if view supports xdg-decoration (diff) | |
download | sway-06c214a800cab9119ae4b04371e3f6bbca8a0550.tar.gz sway-06c214a800cab9119ae4b04371e3f6bbca8a0550.tar.zst sway-06c214a800cab9119ae4b04371e3f6bbca8a0550.zip |
Merge pull request #2703 from RyanDwyer/csd-border
Add CSD to border modes
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index a12ac854..4c710f7e 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -243,12 +243,14 @@ static bool wants_floating(struct sway_view *view) { | |||
243 | return false; | 243 | return false; |
244 | } | 244 | } |
245 | 245 | ||
246 | static bool has_client_side_decorations(struct sway_view *view) { | 246 | static void handle_set_decorations(struct wl_listener *listener, void *data) { |
247 | if (xwayland_view_from_view(view) == NULL) { | 247 | struct sway_xwayland_view *xwayland_view = |
248 | return false; | 248 | wl_container_of(listener, xwayland_view, set_decorations); |
249 | } | 249 | struct sway_view *view = &xwayland_view->view; |
250 | struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; | 250 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; |
251 | return surface->decorations != WLR_XWAYLAND_SURFACE_DECORATIONS_ALL; | 251 | |
252 | bool csd = xsurface->decorations != WLR_XWAYLAND_SURFACE_DECORATIONS_ALL; | ||
253 | view_update_csd_from_client(view, csd); | ||
252 | } | 254 | } |
253 | 255 | ||
254 | static void _close(struct sway_view *view) { | 256 | static void _close(struct sway_view *view) { |
@@ -274,7 +276,6 @@ static const struct sway_view_impl view_impl = { | |||
274 | .set_tiled = set_tiled, | 276 | .set_tiled = set_tiled, |
275 | .set_fullscreen = set_fullscreen, | 277 | .set_fullscreen = set_fullscreen, |
276 | .wants_floating = wants_floating, | 278 | .wants_floating = wants_floating, |
277 | .has_client_side_decorations = has_client_side_decorations, | ||
278 | .close = _close, | 279 | .close = _close, |
279 | .destroy = destroy, | 280 | .destroy = destroy, |
280 | }; | 281 | }; |
@@ -343,6 +344,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
343 | wl_list_remove(&xwayland_view->set_role.link); | 344 | wl_list_remove(&xwayland_view->set_role.link); |
344 | wl_list_remove(&xwayland_view->set_window_type.link); | 345 | wl_list_remove(&xwayland_view->set_window_type.link); |
345 | wl_list_remove(&xwayland_view->set_hints.link); | 346 | wl_list_remove(&xwayland_view->set_hints.link); |
347 | wl_list_remove(&xwayland_view->set_decorations.link); | ||
346 | wl_list_remove(&xwayland_view->map.link); | 348 | wl_list_remove(&xwayland_view->map.link); |
347 | wl_list_remove(&xwayland_view->unmap.link); | 349 | wl_list_remove(&xwayland_view->unmap.link); |
348 | view_begin_destroy(&xwayland_view->view); | 350 | view_begin_destroy(&xwayland_view->view); |
@@ -613,6 +615,10 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
613 | wl_signal_add(&xsurface->events.set_hints, &xwayland_view->set_hints); | 615 | wl_signal_add(&xsurface->events.set_hints, &xwayland_view->set_hints); |
614 | xwayland_view->set_hints.notify = handle_set_hints; | 616 | xwayland_view->set_hints.notify = handle_set_hints; |
615 | 617 | ||
618 | wl_signal_add(&xsurface->events.set_decorations, | ||
619 | &xwayland_view->set_decorations); | ||
620 | xwayland_view->set_decorations.notify = handle_set_decorations; | ||
621 | |||
616 | wl_signal_add(&xsurface->events.unmap, &xwayland_view->unmap); | 622 | wl_signal_add(&xsurface->events.unmap, &xwayland_view->unmap); |
617 | xwayland_view->unmap.notify = handle_unmap; | 623 | xwayland_view->unmap.notify = handle_unmap; |
618 | 624 | ||