Skip paint event when in the middle of a buffer operation
This is detected when an undo group is open and contains at east one
element. This means indeed that changes are in progress. Note that the
group is in general opened in GuiApplication::dispatch. The code there
is changed to ensure that the group is closed before updating the
screen.
This patch is experimental. It is expected to be replaced in master by
a more complete solution. It could in the meantime be backported to 2.3.x.
Fixes bug #11159.
(cherry picked from commit
c7496a11b2f0bd714b6c2ee0f7189ff420e014ce)
(cherry picked from commit
4d0c43f9aa944649d4b5788c5de98d37c280a036)