They are analogous if you represent side effects like this:<p><pre><code>    new_state = f(old_state, x)
</code></pre>
then an idempotent operation is<p><pre><code>    f(f(state, x), x) == f(state, x)
</code></pre>
In the context of drawing windows:<p><pre><code>    draw(draw(fbuf, wnd, x, y), wnd, x, y) == draw(fbuf, wnd, x, y)
</code></pre>
but this is of course false if you allow alpha channel transparency...