diff options
author | emersion <contact@emersion.fr> | 2018-07-12 20:01:33 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-12 20:01:33 +0100 |
commit | 9b16227ec3cfc648f177f186d29b9f0002b7bbde (patch) | |
tree | ee6301c035e72ade212ed85c53df867e31bf72cb | |
parent | Merge pull request #2250 from RyanDwyer/fix-crash (diff) | |
download | sway-9b16227ec3cfc648f177f186d29b9f0002b7bbde.tar.gz sway-9b16227ec3cfc648f177f186d29b9f0002b7bbde.tar.zst sway-9b16227ec3cfc648f177f186d29b9f0002b7bbde.zip |
Don't disable borders for xwayland floating views
-rw-r--r-- | include/sway/tree/view.h | 1 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 9 | ||||
-rw-r--r-- | sway/tree/view.c | 6 |
3 files changed, 15 insertions, 1 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 7dc8ac46..21d6403e 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -35,6 +35,7 @@ struct sway_view_impl { | |||
35 | void (*set_tiled)(struct sway_view *view, bool tiled); | 35 | void (*set_tiled)(struct sway_view *view, bool tiled); |
36 | void (*set_fullscreen)(struct sway_view *view, bool fullscreen); | 36 | void (*set_fullscreen)(struct sway_view *view, bool fullscreen); |
37 | bool (*wants_floating)(struct sway_view *view); | 37 | bool (*wants_floating)(struct sway_view *view); |
38 | bool (*has_client_side_decorations)(struct sway_view *view); | ||
38 | void (*for_each_surface)(struct sway_view *view, | 39 | void (*for_each_surface)(struct sway_view *view, |
39 | wlr_surface_iterator_func_t iterator, void *user_data); | 40 | wlr_surface_iterator_func_t iterator, void *user_data); |
40 | void (*close)(struct sway_view *view); | 41 | void (*close)(struct sway_view *view); |
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 4e5cea7d..460d1cc8 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -246,6 +246,14 @@ static bool wants_floating(struct sway_view *view) { | |||
246 | return false; | 246 | return false; |
247 | } | 247 | } |
248 | 248 | ||
249 | static bool has_client_side_decorations(struct sway_view *view) { | ||
250 | if (xwayland_view_from_view(view) == NULL) { | ||
251 | return false; | ||
252 | } | ||
253 | struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; | ||
254 | return surface->decorations != WLR_XWAYLAND_SURFACE_DECORATIONS_ALL; | ||
255 | } | ||
256 | |||
249 | static void _close(struct sway_view *view) { | 257 | static void _close(struct sway_view *view) { |
250 | if (xwayland_view_from_view(view) == NULL) { | 258 | if (xwayland_view_from_view(view) == NULL) { |
251 | return; | 259 | return; |
@@ -269,6 +277,7 @@ static const struct sway_view_impl view_impl = { | |||
269 | .set_tiled = set_tiled, | 277 | .set_tiled = set_tiled, |
270 | .set_fullscreen = set_fullscreen, | 278 | .set_fullscreen = set_fullscreen, |
271 | .wants_floating = wants_floating, | 279 | .wants_floating = wants_floating, |
280 | .has_client_side_decorations = has_client_side_decorations, | ||
272 | .close = _close, | 281 | .close = _close, |
273 | .destroy = destroy, | 282 | .destroy = destroy, |
274 | }; | 283 | }; |
diff --git a/sway/tree/view.c b/sway/tree/view.c index 20cbaf1c..b356183c 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -315,7 +315,11 @@ void view_set_activated(struct sway_view *view, bool activated) { | |||
315 | } | 315 | } |
316 | 316 | ||
317 | void view_set_tiled(struct sway_view *view, bool tiled) { | 317 | void view_set_tiled(struct sway_view *view, bool tiled) { |
318 | view->border = tiled ? config->border : B_NONE; | 318 | bool csd = true; |
319 | if (view->impl->has_client_side_decorations) { | ||
320 | csd = view->impl->has_client_side_decorations(view); | ||
321 | } | ||
322 | view->border = tiled || !csd ? config->border : B_NONE; | ||
319 | if (view->impl->set_tiled) { | 323 | if (view->impl->set_tiled) { |
320 | view->impl->set_tiled(view, tiled); | 324 | view->impl->set_tiled(view, tiled); |
321 | } | 325 | } |