<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>

<p dir="auto">When calling <code class="notranslate">matplotlib</code> on  macOS the user is logged out...</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="from matplotlib import pyplot as plt

plt.plot()
plt.show()"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</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">plot</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>

<p dir="auto">The user is logged out, the screen turns black for a few seconds and then the macOS login screen appears.</p>
<p dir="auto"><strong>Expected outcome</strong></p>


<p dir="auto">I don't expect such a huge problem (user logged out) with the previous code snippet...</p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: macOS 10.14.6</li>
<li>Matplotlib version: 3.1.1</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): TkAgg</li>
<li>Python version: 3.6</li>
</ul>


<p dir="auto">Python and <code class="notranslate">matplotlib</code> installation using <code class="notranslate">miniconda</code>:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="conda create -n test python=3.6 ipython
conda activate test
conda install matplotlib"><pre class="notranslate">conda create -n <span class="pl-c1">test</span> python=3.6 ipython
conda activate <span class="pl-c1">test</span>
conda install matplotlib</pre></div>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Trying to view a plot made with Python 3.7, Spyder, and IPython with the Tkinter backend causes a crash and the macOS Mojave login screen appears.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<p dir="auto">Any kind of plot will cause the problem.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 10)
y = 2 * x
plt.plot(x, y)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<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">x</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">10</span>)
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span> <span class="pl-c1">*</span> <span class="pl-s1">x</span>
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto">Crash and the Mojave 10.14.6 login screen appears.</p>
<p dir="auto">The problem started occurring after the update to Mojave 10.14.6. When I create a plot and click on the plot window icon on the dock, the screen goes black for a second and the macOS login screen appears. After I log in, the windows of Anaconda Navigator and Spyder are gone and their icons are no longer present on the Dock. Activity Monitor however indicates that python is still running.</p>
<p dir="auto">I have reproduced this behavior a few times. Switching the IPython backend to Qt5 solved the problem.</p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">A plot.</p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: MacOS Mojave 10.14.6 (Darwin 18.7.0)</li>
<li>Matplotlib version: 3.1.0</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): Tkinter</li>
<li>Python version: 3.7.3</li>
<li>Jupyter version (if applicable): n/a</li>
<li>Other libraries: Spyder 3.3.6, IPython 7.6.1<br>
Running the stock Anaconda Distribution 2019.07.</li>
</ul>