aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-06-30 22:46:25 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-06-30 22:46:25 +1000
commite396af853b01438f7e5ef34bfa6fd2507d11ce5a (patch)
tree323739dc80680dd774acfdcf43eb76cfe93aa64c /sway/desktop/xdg_shell.c
parentfc6fde7d90ee031539252cb8832e11c38cfed686 (diff)
parent9ba72433b6c87086f2772405e09e8ac8c0136a01 (diff)
Merge remote-tracking branch 'upstream/master' into atomic
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 0f45399d..da3a1cdd 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -108,6 +108,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;
@@ -157,6 +170,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,
@@ -288,8 +302,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));