aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-31 19:58:34 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-31 19:58:34 +1000
commit7a59508da467a3b793e355e28ae67ce04633761c (patch)
tree0f72b5b1804f6f6afa3b2317a4d9e3cc402fda9a /sway/desktop/output.c
parentFix popups (diff)
downloadsway-7a59508da467a3b793e355e28ae67ce04633761c.tar.gz
sway-7a59508da467a3b793e355e28ae67ce04633761c.tar.zst
sway-7a59508da467a3b793e355e28ae67ce04633761c.zip
Close popups when changing focus
Also reverts the send frame done changes from the previous commit.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 4c9d978c..66747a3f 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -312,9 +312,8 @@ static void send_frame_done_container_iterator(struct sway_container *con,
312 return; 312 return;
313 } 313 }
314 314
315 // Toplevels only 315 output_view_for_each_surface(data->output, con->sway_view,
316 output_surface_for_each_surface(data->output, con->sway_view->surface, 316 send_frame_done_iterator, data->when);
317 con->x, con->y, send_frame_done_iterator, data->when);
318} 317}
319 318
320static void send_frame_done_container(struct sway_output *output, 319static void send_frame_done_container(struct sway_output *output,
@@ -327,27 +326,6 @@ static void send_frame_done_container(struct sway_output *output,
327 send_frame_done_container_iterator, &data); 326 send_frame_done_container_iterator, &data);
328} 327}
329 328
330static void send_frame_done_popup_iterator(struct sway_output *output,
331 struct wlr_surface *surface, struct wlr_box *box, float rotation,
332 void *data) {
333 // Send frame done to this popup's surface
334 send_frame_done_iterator(output, surface, box, rotation, data);
335
336 // Send frame done to this popup's child toplevels
337 output_surface_for_each_surface(output, surface, box->x, box->y,
338 send_frame_done_iterator, data);
339}
340
341static void send_frame_done_popups(struct sway_output *output,
342 struct sway_view *view, struct timespec *when) {
343 struct send_frame_done_data data = {
344 .output = output,
345 .when = when,
346 };
347 output_view_for_each_popup(output, view,
348 send_frame_done_popup_iterator, &data);
349}
350
351static void send_frame_done(struct sway_output *output, struct timespec *when) { 329static void send_frame_done(struct sway_output *output, struct timespec *when) {
352 if (output_has_opaque_overlay_layer_surface(output)) { 330 if (output_has_opaque_overlay_layer_surface(output)) {
353 goto send_frame_overlay; 331 goto send_frame_overlay;
@@ -385,13 +363,6 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) {
385 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], when); 363 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], when);
386 } 364 }
387 365
388 struct sway_seat *seat = input_manager_current_seat(input_manager);
389 struct sway_container *focus = seat_get_focus(seat);
390 if (focus && focus->type == C_VIEW) {
391 send_frame_done_popups(output, focus->sway_view, when);
392 }
393
394
395send_frame_overlay: 366send_frame_overlay:
396 send_frame_done_layer(output, 367 send_frame_done_layer(output,
397 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], when); 368 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], when);