<html><head>

  <style type="text/css"><!--#x5bdc69eb930544a blockquote.cite
{margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right: 0px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204);}
#x5bdc69eb930544a blockquote.cite2
{margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right: 0px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 3px; padding-top: 0px;}
#x5bdc69eb930544a
{font-family: Helvetica; font-size: 9pt;}
--></style><style id="css_styles" type="text/css"><!--blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: center; '], li[style='text-align: right;'], li[style='text-align: right; '] {  list-style-position: inside;}
body { font-family: Helvetica; font-size: 9pt; }
.quote { margin-left: 1em; margin-right: 1em; border-left: 5px #ebebeb solid; padding-left: 0.3em; }
--></style></head>
  <body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><div id="x5272c4ac09a94a138aa37322a7859bd2">FWIW: I wrapped this exploration up by submitting two bug reports: 9074851, 9074856 .</div></div><div id="x5272c4ac09a94a138aa37322a7859bd2"><span><br /></span></div><div id="x5272c4ac09a94a138aa37322a7859bd2"><span>Regards,</span></div><div id="x5272c4ac09a94a138aa37322a7859bd2"><span> - Jeremy</span></div>
<div><br /></div>
<div>
<div>------ Original Message ------</div>
<div>From "Jeremy Wood" <<a href="mailto:mickleness@gmail.com">mickleness@gmail.com</a>></div>
<div>To "Philip Race" <<a href="mailto:philip.race@oracle.com">philip.race@oracle.com</a>>; "Harshitha Onkar" <<a href="mailto:harshitha.onkar@oracle.com">harshitha.onkar@oracle.com</a>></div>
<div>Cc "<a href="mailto:client-libs-dev@openjdk.org">client-libs-dev@openjdk.org</a>" <<a href="mailto:client-libs-dev@openjdk.org">client-libs-dev@openjdk.org</a>></div>
<div>Date 2/18/2023 5:22:25 AM</div>
<div>Subject Re[2]: Stage Manager Problems</div></div><div><br /></div>
<div id="x5bdc69eb930544a" style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><blockquote cite="emc3b9f388-53f2-404a-b4eb-8757cebbcbd6@cecdd4f4.com" type="cite" class="cite2">
<div>I made a 5 min video here:</div><div><br /></div><div><a href="https://drive.google.com/file/d/1al0huWBGhdSeqXrNU_if8HpQGOrxFMFH/view?usp=sharing">https://drive.google.com/file/d/1al0huWBGhdSeqXrNU_if8HpQGOrxFMFH/view?usp=sharing</a></div>
<div style="clear:both"><br /></div><div style="clear:both">(I’ll delete this link in a month or two.)</div><div style="clear:both"><br /></div><div style="clear:both">It shows the original complaint, but also around t=3 min it starts to show a worse problem:</div><div style="clear:both"><br /></div><div style="clear:both">If you have Stage Manager active and you iconify a JFrame, the JFrame never returns to a Frame.NORMAL state. (At least not in this simple test.) This leads to major repaint problems.</div><div style="clear:both"><br /></div><div style="clear:both">So… my immediate question is: now what?</div><div style="clear:both"><br /></div><div style="clear:both">Should I take what I have and just submit an openJDK ticket? (Or a separate ticket for each problem?) Is it OK to write a ticket with an undefined expected behavior, or is that something we should try to clarify here first?</div><div style="clear:both"><br /></div><div style="clear:both">Regards,</div><div style="clear:both"> - Jeremy</div><div style="clear:both"><br /></div>
<div><br /></div>
<div>
<div>------ Original Message ------</div>
<div>From "Philip Race" <<a href="mailto:philip.race@oracle.com">philip.race@oracle.com</a>></div>
<div>To "Jeremy Wood" <<a href="mailto:mickleness@gmail.com">mickleness@gmail.com</a>>; "Harshitha Onkar" <<a href="mailto:harshitha.onkar@oracle.com">harshitha.onkar@oracle.com</a>></div>
<div>Cc "<a href="mailto:client-libs-dev@openjdk.org">client-libs-dev@openjdk.org</a>" <<a href="mailto:client-libs-dev@openjdk.org">client-libs-dev@openjdk.org</a>></div>
<div>Date 2/16/2023 1:31:23 PM</div>
<div>Subject Re: Stage Manager Problems</div></div><div><br /></div>
<div id="xc52c24be3cc046e"><blockquote cite="78528704-678e-f117-1af8-83ac93b79365@oracle.com" type="cite" class="cite2">

    <div>>The more I look at this: I’m afraid the crux of this
      problem is Stage Manager has introduced a new window state that
      Java’s AWT architecture can’t really describe yet. (But I’d love
      to be proved wrong…?)
<br />
      <br />
      I think you are right. I do not have Ventura to see / test for
      myself but everything I am hearing
<br />
      sounds like with Stage Manager active the "minimise" button just
      causes a different compositing transform
<br />
      to be applied to the window and adds that gesture blocking overlay
      to make it so that it can't see mouse events
<br />
      or presumably receive focus for keyboard events, and the app is
      *intentionally* (as in Apple's intention)
<br />
      ignorant of anything having changed in its state.<br />
      <br />
      So it is anyone's guess what we can do about this and even if we
      should do something  what would it be ..
<br />
      Maybe there's some clue in the latest SDK - ie a new API ?<br />
      <br />
      FWIW One of our team members said he tried this mode for 5 mins
      but multiple (non-java) apps were
<br />
      so broken in this mode he turned it off again.<br />
      <br />
      <br />
      <br />
      -phil.<br />
    </div>
    <br />
    <br />
    <div class="moz-cite-prefix">On 2/16/23 2:04 AM, Jeremy Wood wrote:<br />
    </div>
    <blockquote type="cite" cite="mid:em7b75128a-93a4-462c-a802-4a1b7a71000f@17fbc042.com" class="cite">
      
      <style type="text/css"><!--#x5bdc69eb930544a #xc52c24be3cc046e #x74a97db6f65d497 p.MsoNormal
{margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;}
#x5bdc69eb930544a #xc52c24be3cc046e #x74a97db6f65d497 a:link
{color: blue; text-decoration: underline;}
#x5bdc69eb930544a #xc52c24be3cc046e #x74a97db6f65d497 li.MsoListParagraph
{margin: 0in 0in 0in 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;}
#x5bdc69eb930544a #xc52c24be3cc046e #x74a97db6f65d497 div.WordSection1
{page: WordSection1;}
#x5bdc69eb930544a #xc52c24be3cc046e #x74a97db6f65d497 ol
{margin-bottom: 0in;}
#x5bdc69eb930544a #xc52c24be3cc046e blockquote.cite
{margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right: 0px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204);}
#x5bdc69eb930544a #xc52c24be3cc046e blockquote.cite2
{margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right: 0px; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 3px; padding-top: 0px;}
#x5bdc69eb930544a #xc52c24be3cc046e a img
{border: 0px;}
#x5bdc69eb930544a #xc52c24be3cc046e
{font-family: Helvetica; font-size: 9pt;}
#x5bdc69eb930544a #xc52c24be3cc046e .quote
{margin-left: 1em; margin-right: 1em; border-left-width: 5px; border-left-style: solid; border-left-color: rgb(235, 235, 235); padding-left: 0.3em;}
--></style>
      
      <div>Harshitha,</div>
      <div><br />
      </div>
      <div>Thanks for the suggestions. I think those don’t really
        resolve the problem, though.
</div>
      <div><br />
      </div>
      <div>In the original sample program (having only 1 frame) watching
        the keyboard focus could help identify when there’s a change,
        but if there’s a second frame: that second window could retain
        the focus and the first window still can’t answer the question,
        “Are you minimized now?”
</div>
      <div>
        <div id="xb7307ab26ea540968109403190bd3a01">
          <div><br />
          </div>
          <div>(I have an updated <a href="https://drive.google.com/file/d/1uzUUDnAlPoHlFdbVgunwpFKvn4Ies-6-/view?usp=sharing" moz-do-not-send="true">sample program</a> here with two
            frames if anyone’s interested.)
</div>
          <div><br />
          </div>
        </div>
      </div>
      <div>Further: the window could lose the focus at any time (if a
        system dialog came up), so I don’t think focus should act as a
        proxy for visibility.
</div>
      <div><br />
      </div>
      <div>I did find tonight a work-around for our app a few hours ago.
        We have some native code that identifies all visible windows,
        their bounds and their title. If I consult that list: I see a
        window that matches our (sufficiently unique) window title. And
        its bounds do not at all match with what Java says our window’s
        bounds are. And it is positioned so 99% of it overlaps with a
        window called “Gesture Blocking Overlay”. (All Stage Manager
        thumbnails appear to have an overlay window with this title.) So
        it’s a very kludgy and brittle work around, for for the time
        being it works.
</div>
      <div><br />
      </div>
      <div>This leads me to believe the Mac OS windowing system doesn’t
        consider the frame to be “hidden”. I think the window remains
        technically visible. And Mac OS knows it has new bounds. But the
        peer in Java is oblivious to the new bounds/state. (I examined
        the peer LWWindowPeer in a debugger: it still thinks the window
        is visible (technically true) and its bounds are unchanged (not
        true).)
</div>
      <div><br />
      </div>
      <div>The more I look at this: I’m afraid the crux of this problem
        is Stage Manager has introduced a new window state that Java’s
        AWT architecture can’t really describe yet. (But I’d love to be
        proved wrong…?)
</div>
      <div><br />
      </div>
      <div> - Jeremy</div>
      <div><br />
      </div>
      <div>
        <div>------ Original Message ------</div>
        <div>From "Harshitha Onkar" <<a href="mailto:harshitha.onkar@oracle.com" moz-do-not-send="true" class="moz-txt-link-freetext">harshitha.onkar@oracle.com</a>></div>
        <div>To "Jeremy Wood" <<a href="mailto:mickleness@gmail.com" moz-do-not-send="true" class="moz-txt-link-freetext">mickleness@gmail.com</a>></div>
        <div>Cc "<a href="mailto:client-libs-dev@openjdk.org" moz-do-not-send="true" class="moz-txt-link-freetext">client-libs-dev@openjdk.org</a>"
          <
<a href="mailto:client-libs-dev@openjdk.org" moz-do-not-send="true" class="moz-txt-link-freetext">client-libs-dev@openjdk.org</a>></div>
        <div>Date 2/16/2023 1:57:56 AM</div>
        <div>Subject RE: Stage Manager Problems</div>
      </div>
      <div><br />
      </div>
      <div id="x74a97db6f65d497" style="word-wrap:break-word">
        <blockquote cite="BYAPR10MB3350EEB6F196F7440CF1E9AC80A09@BYAPR10MB3350.namprd10.prod.outlook.com" type="cite" class="cite2">
          <div class="WordSection1">
            <p class="MsoNormal"><span style="font-size:12.0pt">Hi
                Jeremy,
<o:p xmlns:o="#unknown"></o:p></span></p>
            <p class="MsoNormal"><span style="font-size:12.0pt"><o:p xmlns:o="#unknown"> </o:p></span></p>
            <p class="MsoNormal"><span style="font-size:12.0pt">Does any
                of the following options help in your case to determine
                whether or not the frame is iconified?
                
<o:p xmlns:o="#unknown"></o:p></span></p>
            <p class="MsoNormal"><span style="font-size:12.0pt"><o:p xmlns:o="#unknown"> </o:p></span></p>
            <ol style="margin-top:0in" type="1" start="1">
              <li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo2"><span style="font-size:12.0pt">frame.isActive()
                  <o:p xmlns:o="#unknown"></o:p></span></li>
              <li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo2"><span style="font-size:12.0pt">frame.isFocused()
                  <o:p xmlns:o="#unknown"></o:p></span></li>
              <li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo2"><span style="font-size:12.0pt">frame.isAlwaysOnTop()<o:p xmlns:o="#unknown"></o:p></span></li>
            </ol>
            <p class="MsoNormal"><span style="font-size:12.0pt"><o:p xmlns:o="#unknown"> </o:p></span></p>
            <p class="MsoNormal"><span style="font-size:12.0pt">Thanks
                & Regards,
<o:p xmlns:o="#unknown"></o:p></span></p>
            <p class="MsoNormal"><span style="font-size:12.0pt">Harshitha
                Onkar
<o:p xmlns:o="#unknown"></o:p></span></p>
            <p class="MsoNormal"><o:p xmlns:o="#unknown"> </o:p></p>
            <div>
              <div style="border:none;border-top:solid #E1E1E1&#xA;                1.0pt;padding:3.0pt 0in 0in 0in&#xA;">
                <p class="MsoNormal"><b>From:</b> client-libs-dev <<a href="mailto:client-libs-dev-retn@openjdk.org" moz-do-not-send="true" class="moz-txt-link-freetext">client-libs-dev-retn@openjdk.org</a>>
                  <b>On Behalf Of </b>Jeremy Wood<br />
                  <b>Sent:</b> Wednesday, February 15, 2023 10:08 PM<br />
                  <b>To:</b> <a href="mailto:client-libs-dev@openjdk.org" moz-do-not-send="true" class="moz-txt-link-freetext">client-libs-dev@openjdk.org</a><br />
                  <b>Subject:</b> Stage Manager Problems<o:p xmlns:o="#unknown"></o:p></p>
              </div>
            </div>
            <p class="MsoNormal"><o:p xmlns:o="#unknown"> </o:p></p>
            <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">We’re
                experiencing problems related JFrames while 
<a href="https://www.computerworld.com/article/3667999/what-is-apple-stage-manager-and-how-is-it-used.html" moz-do-not-send="true">Stage Manager</a> is active
                Mac.
<o:p xmlns:o="#unknown"></o:p></span></p>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p xmlns:o="#unknown"> </o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">When
                  Stage Manager is active the yellow minimize button on
                  our JFrame’s appears to “minimize” our app. But as far
                  as our Frame is concerned:
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">1.
                  Frame.getExtendedState() does not indicate we’re in an
                  ICONIFIED state
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">2.
                  Frame.isShowing() returns true
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">3.
                  a java.awt.desktop.AppForegroundListener believes our
                  app is in the foreground.
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p xmlns:o="#unknown"> </o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">We
                  want to identify when we’re in this hidden state. Is
                  there any other property we can consult to help
                  identify this state?
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p xmlns:o="#unknown"> </o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">I’m
                  happy to submit an openjdk ticket if needed, but first
                  I wanted to sanity check that I’m not missing
                  something. (I also tried
                  
<a href="https://bugs.openjdk.org/issues/?jql=text%20~%20%22%5C%22Stage%20Manager%5C%22%22" moz-do-not-send="true">
                    querying</a> the openJDK bug database, but didn’t
                  see any hits.)
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p xmlns:o="#unknown"> </o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">I
                  tried rummaging around in Mac-specific classes (like
                  CPlatformWindow), but I didn’t see any promising
                  leads. It’s always possible I missed something,
                  though.
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p xmlns:o="#unknown"> </o:p></span></p>
            </div>
            <div>
              <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Attached
                  is a small 200-line demo app.
<o:p xmlns:o="#unknown"></o:p></span></p>
            </div>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br />
  </blockquote></div>


</blockquote></div>
</body></html>