Debug: Add button to duplicate debug window

This commit is contained in:
Jonathan G Rennison
2022-06-07 17:23:10 +01:00
parent 74681f70d9
commit a818157c57
5 changed files with 29 additions and 1 deletions

View File

@@ -1193,6 +1193,22 @@ void DeleteWindowById(WindowClass cls, WindowNumber number, bool force)
}
}
/**
* Delete all windows of its class and window number (if open).
* @param cls Window class
* @param number Number of the window within the window class
* @param force force deletion; if false don't delete when stickied
*/
void DeleteAllWindowsById(WindowClass cls, WindowNumber number, bool force)
{
/* Note: the container remains stable, even when deleting windows. */
for (Window *w : Window::IterateUnordered()) {
if (w->window_class == cls && w->window_number == number && (force || (w->flags & WF_STICKY) == 0)) {
delete w;
}
}
}
/**
* Delete all windows of a given class
* @param cls Window class of windows to delete