<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Semyon,<div class=""><br class=""></div><div class="">I have updated the fix based on your suggestion. The new version is located at <a href="http://cr.openjdk.java.net/~dmarkov/8155197/webrev.02/" class="">http://cr.openjdk.java.net/~dmarkov/8155197/webrev.02/</a></div><div class="">Also I slightly modified the test to simplify it.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Dmitry<br class=""><div><blockquote type="cite" class=""><div class="">On 2 Oct 2017, at 18:32, Semyon Sadetsky <<a href="mailto:semyon.sadetsky@oracle.com" class="">semyon.sadetsky@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" class="">
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    Hi Dmitry,<br class="">
    <br class="">
    <blockquote cite="mid:0EAF6541-6965-4D8C-BB72-16A547751676@oracle.com" type="cite" class="">
      <div class="">
        <div class="">
          <blockquote type="cite" class="">
            <div class="">
              <div bgcolor="#FFFFFF" text="#000000" class=""> Actually
                the parent frame doesn't own the input focus when the
                issue happens. The focus is on the dialog already and
                when FOCUS_GAINED event comes for the dialog the KFM
                discovers that the dialog should not have the focus and
                rejects it in line 588 of the
                DefaultKeyboardFocusManager:<br class="">
                <br class="">
                <meta http-equiv="content-type" content="text/html;
                  charset=utf-8" class="">
                                            restoreFocus(fe,
                newFocusedWindow);<br class="">
                <br class="">
                This happens when the dialog became non-focusable
                (non-visible) after the focus request is sent, but
                before the corresponding FOCUS_GAINED event is handled
                on the EDT. In this case the focus is directly restored
                to the previously focused window which doesn't have the
                focus at this moment and input focus cannot be requested
                to one of its components synchronously.<br class="">
                Please confirm whether you agree on the root cause of
                the bug.<br class="">
                <br class="">
              </div>
            </div>
          </blockquote>
          You are right. I agree with your evaluation.</div>
      </div>
    </blockquote>
    Thanks.<br class="">
    Before setting the restoreFocusTo to toFocus in line 190 I would
    recheck for toFocus.isShowing() && toFocus.canBeFocusOwner()
    once again because the component can be made non-focusable
    concurrently.<br class="">
    <br class="">
    --Semyon<br class="">
    <br class="">
    <br class="">
  </div>

</div></blockquote></div><br class=""></div></body></html>