Files
ags/widget/utils/windows.ts
T
2025-03-11 12:49:58 +07:00

23 lines
550 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);
}
});
// App.get_window("powermenu").set_visible(false);
// App.get_window("Media").set_visible(false);
}
export { close_all_menus };