<div dir="ltr"><div>I have opened a bug about this:</div><div><a href="https://bugs.openjdk.org/browse/JDK-8296621">https://bugs.openjdk.org/browse/JDK-8296621</a></div><div><br></div><div>On Linux scene changes cause focus stealing.</div><div><br></div><div>-- Thiago.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em seg., 7 de nov. de 2022 às 13:19, John Hendrikx <<a href="mailto:john.hendrikx@gmail.com">john.hendrikx@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Sorry, I was confused which requestFocus you meant, I was looking
      at Scene#requestFocus(Node).</p>
    <p>--John<br>
    </p>
    <div>On 07/11/2022 15:38, Thiago Milczarek
      Sayão wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>It was a problem in the past gtk glass, but now it checks
          if visible to request the focus.</div>
        <div><br>
        </div>
        <div>But, there are two situations:</div>
        <div><br>
        </div>
        <div>1 - Most common - there is one Scene and it's created
          before the window is shown. In this case,</div>
        <div>there is no point to request focus;</div>
        <div><br>
        </div>
        <div>2 - The scene has changed. Do we want to issue
          notifications or flash the taskbar because the Scene has
          changed?</div>
        <div><br>
        </div>
        <div>If 2 is "no", then I think this line should be removed.</div>
        <div><br>
        </div>
        <div>If 2 is "yes", then I think we should have an API to
          request attention.</div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">Em seg., 7 de nov. de 2022
            às 05:42, John Hendrikx <<a href="mailto:john.hendrikx@gmail.com" target="_blank">john.hendrikx@gmail.com</a>>
            escreveu:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 07/11/2022 00:32,
            Thiago Milczarek Sayão wrote:<br>
            > While working on native linux glass code I observed
            that <br>
            > requestFocus() is called before show().<br>
            > If the window is not shown (mapped on Xorg), It can't
            be focused.<br>
            Have you observed this to be a problem? I believe the actual
            focus <br>
            acquisition is delayed.<br>
            ><br>
            > The code is on WindowStage.setScene() line 276.<br>
            ><br>
            > It might be the case when switching the scene, but
            should the window <br>
            > be focused in that case?<br>
            ><br>
            > If the user is "focused" on another window and the
            program decides to <br>
            > switch the scene the window would pop and steal the
            focus.<br>
            <br>
            Most window managers won't allow this, even if an
            application does <br>
            request focus.  Instead they'll indicate this in the task
            bar that a <br>
            window wants the focus.<br>
            <br>
            Is this actually happening?<br>
            <br>
            --John<br>
            <br>
          </blockquote>
        </div>
      </div>
    </blockquote>
  </div>

</blockquote></div>