Commit 9c940722 authored by Jehan's avatar Jehan

app: do not add undo step when clearing an already empty channel.

See also bug 787545 about single-clicking with a selection tool creating
an undo step even when there were already no selections.
parent 0d9a85a2
......@@ -1316,10 +1316,14 @@ gimp_channel_real_clear (GimpChannel *channel,
{
if (push_undo)
{
if (! undo_desc)
undo_desc = GIMP_CHANNEL_GET_CLASS (channel)->clear_desc;
if (! channel->empty)
{
/* Don't push an undo if the channel was already empty. */
if (! undo_desc)
undo_desc = GIMP_CHANNEL_GET_CLASS (channel)->clear_desc;
gimp_channel_push_undo (channel, undo_desc);
gimp_channel_push_undo (channel, undo_desc);
}
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment