window: Escape AdwToast title for notifications and refactor to prevent leak
Pango markup is enabled by default for the AdwToast title for operation notifications. This means symbols like "&" cause issues. So let's disable the markup on the toast altogether.
Fixes #3085 (closed)
To test this problem, you can use an example like #3085 (closed). Make a big file, for example with dd if=/dev/urandom of='test & test.bin' count=1GB
. Then right-click on the file and compress it to test & test.zip
. This will take some time, but only an empty notification will be shown. With this fix, it shows properly.
Coincidentally, I was looking at this function some more and found out that there is a possible leaked AdwToast from an unfreed adw_toast_new ()
call if the AdwToast is not added to the AdwToastOverlay. By slightly refactoring, that is also prevented. If that is outside of the scope of this MR, I can open a new one just for the refactor.