src/menu: Attach view to menu and use it when executing actions

This fixes #380
This commit is contained in:
Consolatis 2022-06-09 17:10:36 +02:00 committed by Johan Malm
parent ca9226a7a6
commit 5a4c5de332
5 changed files with 63 additions and 30 deletions

View file

@ -5,6 +5,7 @@
#include <xcb/xcb_icccm.h>
#include "labwc.h"
#include "ssd.h"
#include "menu/menu.h"
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
@ -756,6 +757,12 @@ view_destroy(struct view *view)
wlr_scene_node_set_enabled(&output->layer_tree[top]->node, true);
}
/* If we spawned a window menu, close it */
if (server->menu_current
&& server->menu_current->triggered_by_view == view) {
menu_close_root(server);
}
/* Remove view from server->views */
wl_list_remove(&view->link);
free(view);