aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c4
-rw-r--r--sway/desktop/xdg_shell.c16
-rw-r--r--sway/desktop/xdg_shell_v6.c10
-rw-r--r--sway/desktop/xwayland.c10
4 files changed, 34 insertions, 6 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index f0f1603a..e1c44a28 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -645,7 +645,7 @@ static void render_container_simple(struct sway_output *output,
if (child->sway_view->border == B_NORMAL) {
render_titlebar(output, damage, child, child->x, child->y,
child->width, colors, title_texture, marks_texture);
- } else {
+ } else if (con->sway_view->border != B_NONE) {
render_top_border(output, damage, child, colors);
}
render_view(output, damage, child, colors);
@@ -815,7 +815,7 @@ static void render_floating_container(struct sway_output *soutput,
if (con->sway_view->border == B_NORMAL) {
render_titlebar(soutput, damage, con, con->x, con->y, con->width,
colors, title_texture, marks_texture);
- } else {
+ } else if (con->sway_view->border != B_NONE) {
render_top_border(soutput, damage, con, colors);
}
render_view(soutput, damage, con, colors);
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 8457c06b..6ac0f9c7 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -111,6 +111,19 @@ static void set_activated(struct sway_view *view, bool activated) {
}
}
+static void set_tiled(struct sway_view *view, bool tiled) {
+ if (xdg_shell_view_from_view(view) == NULL) {
+ return;
+ }
+ struct wlr_xdg_surface *surface = view->wlr_xdg_surface;
+ enum wlr_edges edges = WLR_EDGE_NONE;
+ if (tiled) {
+ edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP |
+ WLR_EDGE_BOTTOM;
+ }
+ wlr_xdg_toplevel_set_tiled(surface, edges);
+}
+
static void set_fullscreen(struct sway_view *view, bool fullscreen) {
if (xdg_shell_view_from_view(view) == NULL) {
return;
@@ -164,6 +177,7 @@ static const struct sway_view_impl view_impl = {
.get_string_prop = get_string_prop,
.configure = configure,
.set_activated = set_activated,
+ .set_tiled = set_tiled,
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
.for_each_surface = for_each_surface,
@@ -273,8 +287,6 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) {
wlr_log(L_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'",
xdg_surface->toplevel->title, xdg_surface->toplevel->app_id);
wlr_xdg_surface_ping(xdg_surface);
- wlr_xdg_toplevel_set_tiled(xdg_surface, WLR_EDGE_LEFT | WLR_EDGE_RIGHT |
- WLR_EDGE_TOP | WLR_EDGE_BOTTOM);
struct sway_xdg_shell_view *xdg_shell_view =
calloc(1, sizeof(struct sway_xdg_shell_view));
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index eb1cef26..a37a4caf 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -110,6 +110,14 @@ static void set_activated(struct sway_view *view, bool activated) {
}
}
+static void set_tiled(struct sway_view *view, bool tiled) {
+ if (xdg_shell_v6_view_from_view(view) == NULL) {
+ return;
+ }
+ struct wlr_xdg_surface_v6 *surface = view->wlr_xdg_surface_v6;
+ wlr_xdg_toplevel_v6_set_maximized(surface, tiled);
+}
+
static void set_fullscreen(struct sway_view *view, bool fullscreen) {
if (xdg_shell_v6_view_from_view(view) == NULL) {
return;
@@ -164,6 +172,7 @@ static const struct sway_view_impl view_impl = {
.get_string_prop = get_string_prop,
.configure = configure,
.set_activated = set_activated,
+ .set_tiled = set_tiled,
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
.for_each_surface = for_each_surface,
@@ -273,7 +282,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
wlr_log(L_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'",
xdg_surface->toplevel->title, xdg_surface->toplevel->app_id);
wlr_xdg_surface_v6_ping(xdg_surface);
- wlr_xdg_toplevel_v6_set_maximized(xdg_surface, true);
struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
calloc(1, sizeof(struct sway_xdg_shell_v6_view));
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index df5f6698..fcc8164f 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -199,6 +199,14 @@ static void set_activated(struct sway_view *view, bool activated) {
wlr_xwayland_surface_activate(surface, activated);
}
+static void set_tiled(struct sway_view *view, bool tiled) {
+ if (xwayland_view_from_view(view) == NULL) {
+ return;
+ }
+ struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
+ wlr_xwayland_surface_set_maximized(surface, tiled);
+}
+
static void set_fullscreen(struct sway_view *view, bool fullscreen) {
if (xwayland_view_from_view(view) == NULL) {
return;
@@ -265,6 +273,7 @@ static const struct sway_view_impl view_impl = {
.get_int_prop = get_int_prop,
.configure = configure,
.set_activated = set_activated,
+ .set_tiled = set_tiled,
.set_fullscreen = set_fullscreen,
.wants_floating = wants_floating,
.close = _close,
@@ -309,7 +318,6 @@ static void handle_map(struct wl_listener *listener, void *data) {
xwayland_view->commit.notify = handle_commit;
// Put it back into the tree
- wlr_xwayland_surface_set_maximized(xsurface, true);
view_map(view, xsurface->surface);
if (xsurface->fullscreen) {