diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-07-13 08:28:34 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 08:28:34 +1000 |
commit | 683a307151764f7cad38ff12c4175e8e0cf94226 (patch) | |
tree | 21c8d74ed97be81ed731f92443a4cd726ee8ac4b | |
parent | da8149c066c8bd3fe662337159081600a93950f7 (diff) | |
parent | 53133fdefb1cdd97d21b3d5424868b70642d46dc (diff) | |
download | sway-683a307151764f7cad38ff12c4175e8e0cf94226.tar.xz |
Merge pull request #2255 from emersion/xwayland-floating-borders
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 { void (*set_tiled)(struct sway_view *view, bool tiled); void (*set_fullscreen)(struct sway_view *view, bool fullscreen); bool (*wants_floating)(struct sway_view *view); + bool (*has_client_side_decorations)(struct sway_view *view); void (*for_each_surface)(struct sway_view *view, wlr_surface_iterator_func_t iterator, void *user_data); 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) { 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 _close(struct sway_view *view) { if (xwayland_view_from_view(view) == NULL) { return; @@ -269,6 +277,7 @@ 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, }; 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) { } void view_set_tiled(struct sway_view *view, bool tiled) { - view->border = tiled ? config->border : B_NONE; + bool csd = true; + if (view->impl->has_client_side_decorations) { + csd = view->impl->has_client_side_decorations(view); + } + view->border = tiled || !csd ? config->border : B_NONE; if (view->impl->set_tiled) { view->impl->set_tiled(view, tiled); } |