Bug 773097 was caused by switching layer managers while in the middle of painting. We should set a bit when we start painting, and unset it after we're done, and then assert that the bit is false whenever we're changing layer managers.
Created attachment 651542 [details] [diff] [review]
assert that we're not in the middle of a transaction when switching layer managers
Haven't been able to test this yet, because I didn't have a debug build on this Windows machine, but I believe it would have caught the bug.
This patch does, indeed, work.