mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Don't disable borders for xwayland floating views
This commit is contained in:
parent
abcc2ef9eb
commit
9b16227ec3
3 changed files with 15 additions and 1 deletions
|
@ -35,6 +35,7 @@ struct sway_view_impl {
|
||||||
void (*set_tiled)(struct sway_view *view, bool tiled);
|
void (*set_tiled)(struct sway_view *view, bool tiled);
|
||||||
void (*set_fullscreen)(struct sway_view *view, bool fullscreen);
|
void (*set_fullscreen)(struct sway_view *view, bool fullscreen);
|
||||||
bool (*wants_floating)(struct sway_view *view);
|
bool (*wants_floating)(struct sway_view *view);
|
||||||
|
bool (*has_client_side_decorations)(struct sway_view *view);
|
||||||
void (*for_each_surface)(struct sway_view *view,
|
void (*for_each_surface)(struct sway_view *view,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||||
void (*close)(struct sway_view *view);
|
void (*close)(struct sway_view *view);
|
||||||
|
|
|
@ -246,6 +246,14 @@ static bool wants_floating(struct sway_view *view) {
|
||||||
return false;
|
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) {
|
static void _close(struct sway_view *view) {
|
||||||
if (xwayland_view_from_view(view) == NULL) {
|
if (xwayland_view_from_view(view) == NULL) {
|
||||||
return;
|
return;
|
||||||
|
@ -269,6 +277,7 @@ static const struct sway_view_impl view_impl = {
|
||||||
.set_tiled = set_tiled,
|
.set_tiled = set_tiled,
|
||||||
.set_fullscreen = set_fullscreen,
|
.set_fullscreen = set_fullscreen,
|
||||||
.wants_floating = wants_floating,
|
.wants_floating = wants_floating,
|
||||||
|
.has_client_side_decorations = has_client_side_decorations,
|
||||||
.close = _close,
|
.close = _close,
|
||||||
.destroy = destroy,
|
.destroy = destroy,
|
||||||
};
|
};
|
||||||
|
|
|
@ -315,7 +315,11 @@ void view_set_activated(struct sway_view *view, bool activated) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void view_set_tiled(struct sway_view *view, bool tiled) {
|
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) {
|
if (view->impl->set_tiled) {
|
||||||
view->impl->set_tiled(view, tiled);
|
view->impl->set_tiled(view, tiled);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue