Either I'm blind or you use some development OBS version or plugin that has added such a feature. As far as I see it, 23.2.1, doesn't have a feature to automatically crop a display capture to some window. This is a cool feature I'm waiting for for years, but I don't see it.Right click display capture. Choose Properties. In the dropdown for Crop, select "To Window"