title: Libgdx controller unresponsive after making application fullscreen
body: <p>When making the application full screen with the following call: </p>
  
  <pre><code>Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
  </code></pre>
  
  <p>I no longer have signals from my controller. The issue is not solved by changing the display back from full screen like:</p>
  
  <pre><code> Gdx.graphics.setWindowedMode(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
  </code></pre>
  
  <p>I'm using Gdx version: 1.9.8. It appears this was an issue fixed in a previous version, but I'm not sure what the necessary steps are to get the work around functioning.
  Here's some posts I found about the issue:</p>
  
  <p><a href="https://github.com/libgdx/libgdx/issues/4723" rel="nofollow noreferrer">https://github.com/libgdx/libgdx/issues/4723</a> </p>
  
  <p><a href="https://github.com/GoranM/bdx/issues/518" rel="nofollow noreferrer">https://github.com/GoranM/bdx/issues/518</a> </p>
  
  <p>(this one is old) <a href="http://www.badlogicgames.com/forum/viewtopic.php?f=11&amp;t=10692" rel="nofollow noreferrer">http://www.badlogicgames.com/forum/viewtopic.php?f=11&amp;t=10692</a></p>
  
  <p>Any help is much appreciated. </p>
  
  <hr>
  
  <p>*Edit: This is using the controller extension that can be checked from the libgdx set up application. *</p>
  
  <hr>
  
  <p>Edit2: I can get a responsive controller if I re-poll the controllers like the following:</p>
  
  <pre><code> Array&lt;Controller&gt; controllers = Controllers.getControllers();
  </code></pre>
  
  <p>However, this cannot be done instantly after changing the display mode; I have to wait some amount of time after. I'm not sure what I need to poll to determine how long I have to wait until the controller instances are valid (also, when it is valid to assign a listener). </p>
  
  <hr>
  
  <p>Edit3: The only solution I've been able to come up with is to set a flag inside the resize callback like the following</p>
  
  <pre><code>@Override
  public void resize(int width, int height) {
      resizeDirty = true;
      resizeTimestamp = System.currentTimeMillis();
  }
  </code></pre>
  
  <p>Then in my main loop call:</p>
  
  <pre><code>private void controllerCheck() {
      if (resizeDirty) {
          long currentTime = System.currentTimeMillis();
          if (currentTime &gt; resizeTimestamp + controllerResetDelay) {
              resizeDirty = false;
              //get new controller instance | re-add a controller listener
          }
      }
  }
  </code></pre>
  
  <p>This isn't ideal, I'd rather find a way to listen to when the change in context is done initializing then update the controllers. But I haven't been able to find a hook for that. I'd appreciate it if anyone knows a better way to go about maintaining controllers with change in display mode.</p>