Save unsaved changes window missing missing under special circumstances

Summary:

This is partially related to #5329 (moved). If #5329 (moved) is fixed, this probably couldn't be triggered, but still probably should be looked into.

I happened to notice a way to brake the 'Save changes' window that shows up when you close a document that has been modified in the current Inkscape session. Doing the steps below will prevent it from showing up and Inkscape will close instead of showing it when it should.

Steps to reproduce:

  1. Open Inkscape
  2. Open any file (must open file with an unlocked layer to start).
  3. Go into the "Document Properties" window.
  4. Click (or un-click) the "Checkerboard background" box under 'Background'.
  5. Select any item on the screen and move it.
  6. Click undo (Ctrl+Z)
  7. Close Inkscape.

What happened?

Inkscape closes, even though the * is in the title bar (sometimes it will disappear anyways after Step 6) telling you the document has been modified since you haven't undone the clicking of the "Checkerboard background" box (see #5329 (moved)).

What should have happened?

Inkscape should throw up the 'Save changes' window when you're closing Inkscape due to not undoing the "Checkerboard background" box change yet.

Sample attachments:

Version info

Inkscape 1.1 (c68e22c387, 2021-05-23)  (64-bit version)
Windows 7 SP1 x64
Edited by Nathan Lee