aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-03 13:03:06 +0200
committerGitHub <noreply@github.com>2018-10-03 13:03:06 +0200
commit06c214a800cab9119ae4b04371e3f6bbca8a0550 (patch)
treeeed325e37d02fa71858a33e71ef33961395dd16f /sway/desktop/xwayland.c
parentf74829d390bab2eccd68923c4b8b82a873322168 (diff)
parentf16529e2588f5e71d6777f4c06dfb58b29308cd0 (diff)
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.c20
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) {
return false;
}
-static bool has_client_side_decorations(struct sway_view *view) {
- if (xwayland_view_from_view(view) == NULL) {
- return false;
- }
- struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
- return surface->decorations != WLR_XWAYLAND_SURFACE_DECORATIONS_ALL;
+static void handle_set_decorations(struct wl_listener *listener, void *data) {
+ struct sway_xwayland_view *xwayland_view =
+ wl_container_of(listener, xwayland_view, set_decorations);
+ struct sway_view *view = &xwayland_view->view;
+ struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
+
+ bool csd = xsurface->decorations != WLR_XWAYLAND_SURFACE_DECORATIONS_ALL;
+ view_update_csd_from_client(view, csd);
}
static void _close(struct sway_view *view) {
@@ -274,7 +276,6 @@ static const struct sway_view_impl view_impl = {
.set_tiled = set_tiled,
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
- .has_client_side_decorations = has_client_side_decorations,
.close = _close,
.destroy = destroy,
};
@@ -343,6 +344,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&xwayland_view->set_role.link);
wl_list_remove(&xwayland_view->set_window_type.link);
wl_list_remove(&xwayland_view->set_hints.link);
+ wl_list_remove(&xwayland_view->set_decorations.link);
wl_list_remove(&xwayland_view->map.link);
wl_list_remove(&xwayland_view->unmap.link);
view_begin_destroy(&xwayland_view->view);
@@ -613,6 +615,10 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
wl_signal_add(&xsurface->events.set_hints, &xwayland_view->set_hints);
xwayland_view->set_hints.notify = handle_set_hints;
+ wl_signal_add(&xsurface->events.set_decorations,
+ &xwayland_view->set_decorations);
+ xwayland_view->set_decorations.notify = handle_set_decorations;
+
wl_signal_add(&xsurface->events.unmap, &xwayland_view->unmap);
xwayland_view->unmap.notify = handle_unmap;