Phew, finished the initial implementation of window screencasting in niri! Complete with stream resolution change on window resizing.
Some details are still iffy regarding frame timing and frame callbacks, especially to obscured windows, but it *should* work decently fine for now.
Icons are missing in the portal dialog because apparently Shell keeps track of Wayland app ID to .desktop file mapping internally and returns the .desktop file name to the portal for it to get the icon. Which is a bit too much effort for me to replicate for now. 😅