aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
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/xdg_shell.c
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/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 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));