summaryrefslogtreecommitdiffstats
path: root/sway/desktop
diff options
context:
space:
mode:
authorLibravatar Rostislav Pehlivanov <atomnuker@gmail.com>2018-06-27 17:53:13 +0100
committerLibravatar Rostislav Pehlivanov <atomnuker@gmail.com>2018-06-30 11:10:47 +0100
commite0d0e8f840271ab12533cb16c9a7ccba237adcb3 (patch)
treea81bf679fc25f89cc09516e1920c4496b2e4c2f8 /sway/desktop
parentMerge pull request #2173 from emersion/fix-floating-no-frame-event (diff)
downloadsway-e0d0e8f840271ab12533cb16c9a7ccba237adcb3.tar.gz
sway-e0d0e8f840271ab12533cb16c9a7ccba237adcb3.tar.zst
sway-e0d0e8f840271ab12533cb16c9a7ccba237adcb3.zip
Revert "Don't unmaximize floating views"
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,
645 if (child->sway_view->border == B_NORMAL) { 645 if (child->sway_view->border == B_NORMAL) {
646 render_titlebar(output, damage, child, child->x, child->y, 646 render_titlebar(output, damage, child, child->x, child->y,
647 child->width, colors, title_texture, marks_texture); 647 child->width, colors, title_texture, marks_texture);
648 } else { 648 } else if (con->sway_view->border != B_NONE) {
649 render_top_border(output, damage, child, colors); 649 render_top_border(output, damage, child, colors);
650 } 650 }
651 render_view(output, damage, child, colors); 651 render_view(output, damage, child, colors);
@@ -815,7 +815,7 @@ static void render_floating_container(struct sway_output *soutput,
815 if (con->sway_view->border == B_NORMAL) { 815 if (con->sway_view->border == B_NORMAL) {
816 render_titlebar(soutput, damage, con, con->x, con->y, con->width, 816 render_titlebar(soutput, damage, con, con->x, con->y, con->width,
817 colors, title_texture, marks_texture); 817 colors, title_texture, marks_texture);
818 } else { 818 } else if (con->sway_view->border != B_NONE) {
819 render_top_border(soutput, damage, con, colors); 819 render_top_border(soutput, damage, con, colors);
820 } 820 }
821 render_view(soutput, damage, con, colors); 821 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) {
111 } 111 }
112} 112}
113 113
114static void set_tiled(struct sway_view *view, bool tiled) {
115 if (xdg_shell_view_from_view(view) == NULL) {
116 return;
117 }
118 struct wlr_xdg_surface *surface = view->wlr_xdg_surface;
119 enum wlr_edges edges = WLR_EDGE_NONE;
120 if (tiled) {
121 edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP |
122 WLR_EDGE_BOTTOM;
123 }
124 wlr_xdg_toplevel_set_tiled(surface, edges);
125}
126
114static void set_fullscreen(struct sway_view *view, bool fullscreen) { 127static void set_fullscreen(struct sway_view *view, bool fullscreen) {
115 if (xdg_shell_view_from_view(view) == NULL) { 128 if (xdg_shell_view_from_view(view) == NULL) {
116 return; 129 return;
@@ -164,6 +177,7 @@ static const struct sway_view_impl view_impl = {
164 .get_string_prop = get_string_prop, 177 .get_string_prop = get_string_prop,
165 .configure = configure, 178 .configure = configure,
166 .set_activated = set_activated, 179 .set_activated = set_activated,
180 .set_tiled = set_tiled,
167 .set_fullscreen = set_fullscreen, 181 .set_fullscreen = set_fullscreen,
168 .wants_floating = wants_floating, 182 .wants_floating = wants_floating,
169 .for_each_surface = for_each_surface, 183 .for_each_surface = for_each_surface,
@@ -273,8 +287,6 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) {
273 wlr_log(L_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'", 287 wlr_log(L_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'",
274 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); 288 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id);
275 wlr_xdg_surface_ping(xdg_surface); 289 wlr_xdg_surface_ping(xdg_surface);
276 wlr_xdg_toplevel_set_tiled(xdg_surface, WLR_EDGE_LEFT | WLR_EDGE_RIGHT |
277 WLR_EDGE_TOP | WLR_EDGE_BOTTOM);
278 290
279 struct sway_xdg_shell_view *xdg_shell_view = 291 struct sway_xdg_shell_view *xdg_shell_view =
280 calloc(1, sizeof(struct sway_xdg_shell_view)); 292 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) {
110 } 110 }
111} 111}
112 112
113static void set_tiled(struct sway_view *view, bool tiled) {
114 if (xdg_shell_v6_view_from_view(view) == NULL) {
115 return;
116 }
117 struct wlr_xdg_surface_v6 *surface = view->wlr_xdg_surface_v6;
118 wlr_xdg_toplevel_v6_set_maximized(surface, tiled);
119}
120
113static void set_fullscreen(struct sway_view *view, bool fullscreen) { 121static void set_fullscreen(struct sway_view *view, bool fullscreen) {
114 if (xdg_shell_v6_view_from_view(view) == NULL) { 122 if (xdg_shell_v6_view_from_view(view) == NULL) {
115 return; 123 return;
@@ -164,6 +172,7 @@ static const struct sway_view_impl view_impl = {
164 .get_string_prop = get_string_prop, 172 .get_string_prop = get_string_prop,
165 .configure = configure, 173 .configure = configure,
166 .set_activated = set_activated, 174 .set_activated = set_activated,
175 .set_tiled = set_tiled,
167 .set_fullscreen = set_fullscreen, 176 .set_fullscreen = set_fullscreen,
168 .wants_floating = wants_floating, 177 .wants_floating = wants_floating,
169 .for_each_surface = for_each_surface, 178 .for_each_surface = for_each_surface,
@@ -273,7 +282,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
273 wlr_log(L_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'", 282 wlr_log(L_DEBUG, "New xdg_shell_v6 toplevel title='%s' app_id='%s'",
274 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id); 283 xdg_surface->toplevel->title, xdg_surface->toplevel->app_id);
275 wlr_xdg_surface_v6_ping(xdg_surface); 284 wlr_xdg_surface_v6_ping(xdg_surface);
276 wlr_xdg_toplevel_v6_set_maximized(xdg_surface, true);
277 285
278 struct sway_xdg_shell_v6_view *xdg_shell_v6_view = 286 struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
279 calloc(1, sizeof(struct sway_xdg_shell_v6_view)); 287 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) {
199 wlr_xwayland_surface_activate(surface, activated); 199 wlr_xwayland_surface_activate(surface, activated);
200} 200}
201 201
202static void set_tiled(struct sway_view *view, bool tiled) {
203 if (xwayland_view_from_view(view) == NULL) {
204 return;
205 }
206 struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
207 wlr_xwayland_surface_set_maximized(surface, tiled);
208}
209
202static void set_fullscreen(struct sway_view *view, bool fullscreen) { 210static void set_fullscreen(struct sway_view *view, bool fullscreen) {
203 if (xwayland_view_from_view(view) == NULL) { 211 if (xwayland_view_from_view(view) == NULL) {
204 return; 212 return;
@@ -265,6 +273,7 @@ static const struct sway_view_impl view_impl = {
265 .get_int_prop = get_int_prop, 273 .get_int_prop = get_int_prop,
266 .configure = configure, 274 .configure = configure,
267 .set_activated = set_activated, 275 .set_activated = set_activated,
276 .set_tiled = set_tiled,
268 .set_fullscreen = set_fullscreen, 277 .set_fullscreen = set_fullscreen,
269 .wants_floating = wants_floating, 278 .wants_floating = wants_floating,
270 .close = _close, 279 .close = _close,
@@ -309,7 +318,6 @@ static void handle_map(struct wl_listener *listener, void *data) {
309 xwayland_view->commit.notify = handle_commit; 318 xwayland_view->commit.notify = handle_commit;
310 319
311 // Put it back into the tree 320 // Put it back into the tree
312 wlr_xwayland_surface_set_maximized(xsurface, true);
313 view_map(view, xsurface->surface); 321 view_map(view, xsurface->surface);
314 322
315 if (xsurface->fullscreen) { 323 if (xsurface->fullscreen) {