21 lines
448 B
TypeScript
21 lines
448 B
TypeScript
import { App, Astal, Gtk, Gdk } from "astal/gtk3";
|
|
|
|
function close_all_menus(safe: string) {
|
|
const menuWindows = App.get_windows()
|
|
.filter((w) => {
|
|
if (w.name) {
|
|
return /.*menu/.test(w.name);
|
|
}
|
|
return false;
|
|
})
|
|
.map((window) => window.name);
|
|
|
|
menuWindows.forEach((window) => {
|
|
if (window && window != safe) {
|
|
App.get_window(window)?.set_visible(false);
|
|
}
|
|
});
|
|
}
|
|
|
|
export { close_all_menus };
|