<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">When using pyplot, pyplot.savefig() throws a warning which is non-existent with figure.Figure.savefig(). Upon understanding the warning message and some investigation, it should be associated with figManager adding duplicate "sources of save" to Glib when saving "the current figure" (i.e. it does not recongize the figure being saved is the same as current figure. )</p>
<p dir="auto">This is important as plt.savefig() is usually the way to go when using the matlab style plotting provided by pyplot package. Currently, using plt.gcf().savefig('1.png') would make this error go away, but that's using the object-oriented style of coding, which would require a change in ways of thinking and hence may cause confusion.</p>
<p dir="auto">Suggestion: add a check of the internal figure id in pyplot.savefig() would prevent any duplicates from being generated.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt

plt.figure()
plt.plot([1, 2, 3])
plt.savefig('1.png')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>

<span class="pl-s1">plt</span>.<span class="pl-en">figure</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'1.png'</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto">This shows up in the terminal</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/usr/local/lib/python3.8/dist-packages/matplotlib/backends/backend_gtk3.py:195: Warning: Source ID 4 was not found when attempting to remove it
  GLib.source_remove(self._idle_draw_id)"><pre class="notranslate"><code class="notranslate">/usr/local/lib/python3.8/dist-packages/matplotlib/backends/backend_gtk3.py:195: Warning: Source ID 4 was not found when attempting to remove it
  GLib.source_remove(self._idle_draw_id)
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">No warning should be thrown.</p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: Ubuntu 20.04</li>
<li>Matplotlib version: 3.2.1</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): GTK3Agg</li>
<li>Python version: 3.8.2</li>
</ul>

<p dir="auto">matplotlib was installed via pip3</p>
<p dir="auto">The weekly build with nightly wheels from numpy and pandas<br>
has failed. Check the logs for any updates that need to be<br>
made in matplotlib.<br>
<a href="https://github.com/matplotlib/matplotlib/actions/runs/5560712365">https://github.com/matplotlib/matplotlib/actions/runs/5560712365</a></p>