[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] RFR: 8088395: Print dialogs are not blocking/modal w.r.t specified owner window
From:       Prasanta Sadhukhan <prasanta.sadhukhan () oracle ! com>
Date:       2017-03-15 5:48:05
Message-ID: 09b06da8-8127-caa3-4125-63297641187b () oracle ! com
[Download RAW message or body]

Looks good to me.

Regards
Prasanta
On 3/14/2017 11:02 PM, Phil Race wrote:
> I have updated webrevs described below, and also I answer your questions
>
> FX is updated only to fix trailing white space and one modifier ordering
> http://cr.openjdk.java.net/~prr/8088395.1/
>
> The JDK side has a few modifications :
> http://cr.openjdk.java.net/~prr/8176350.1/
> (a) awt_PrintDialog.cpp and awt_PrintJob.cpp have an added safety check.
> We now call ::IsWindowHandle(id) as we do elsewhere to make sure its 
> valid.
>
> (b) The Page Setup Dialog on Linux was not seeing the AlwaysOnTop 
> property.
> In part this was because it wasn't being checked in 
> ServiceDialog.initPageDialog() - fixed
> In other part it is because the attributes weren't propagated. The 
> reason for this is
> a bit lengthy to explain but the main thing to say is that we have an 
> instance variable
> attributes as well as a local variable in some places.
> I didn't want to touch any code that even theoretically might affect 
> 2D printing so
> instead I cached the attribute as we do the owner id so it is passed 
> on properly
> Thanks to Kevin for spotting this problem
>
>
> On 03/14/2017 09:02 AM, Sergey Bylokhov wrote:
>> Hi, Phil.
>> I have only two questions:
>>  - Does it mean that we do not support "ontop" property via public 
>> API in idk?
>
> There is no API for the "alwaysOnTop" AWT property for the print dialogs.
> I actually don't think it can be implemented for the windows native 
> print controls.
> There is an internal way to make an AWT window owner for the Swing 
> print dialog
> but nothing public and it doesn't help here as the owner is not an AWT 
> window.
>
>
>>  - Probably the name should contain  «owner » instead of  «parent »?, But 
>> since this is not a public API I guess it is not an issue.
>
> I suppose that is more correct. Something to address if it ever makes 
> its way into API or docs.
>
> -phil.
>
>>
>>>
>>>
>>> This has an FX bug + webrev :
>>> https://bugs.openjdk.java.net/browse/JDK-8088395
>>> http://cr.openjdk.java.net/~prr/8088395/index.html 
>>> <http://cr.openjdk.java.net/%7Eprr/8088395/index.html>
>>>
>>> and also a JDK-side fix and webrev :-
>>> https://bugs.openjdk.java.net/browse/JDK-8176530
>>> http://cr.openjdk.java.net/~prr/8176350/
>>>
>>> The problem is FX modal dialogs are ignoring the Window parameter.
>>> We can fix the problem with disabling the modal parent on the FX side
>>> and that is why most files in FX are updated.
>>>
>>> But it does not fix the "on top" issue which requires the JDK fixes and
>>> to pass in the DialogOnTop private attribute.
>>> The JDK code is there solely for FX and won't have any visibility
>>> unless FX passes in the private attribute.
>>>
>>> On Linux it uses the standard AWT "always on top" modality
>>> On windows it uses the HWND for the FX window and windows native 
>>> modality
>>> On Mac you won't see anything since Mac does this automatically
>>>
>>> -phil.
>>
>


[Attachment #3 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Looks good to me.<br>
    </p>
    Regards<br>
    Prasanta<br>
    <div class="moz-cite-prefix">On 3/14/2017 11:02 PM, Phil Race wrote:<br>
    </div>
    <blockquote
      cite="mid:10d9895a-4fbe-52a0-124d-9bffeded915e@oracle.com"
      type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      I have updated webrevs described below, and also I answer your
      questions <br>
      <br>
      FX is updated only to fix trailing white space and one modifier
      ordering<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
        href="http://cr.openjdk.java.net/%7Eprr/8088395.1/">http://cr.openjdk.java.net/~prr/8088395.1/</a><br>
  <br>
      The JDK side has a few modifications :<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
        href="http://cr.openjdk.java.net/%7Eprr/8176350.1/">http://cr.openjdk.java.net/~prr/8176350.1/</a><br>
  (a) awt_PrintDialog.cpp and awt_PrintJob.cpp have an added safety
      check.<br>
      We now call ::IsWindowHandle(id) as we do elsewhere to make sure
      its valid. <br>
      <br>
      (b) The Page Setup Dialog on Linux was not seeing the AlwaysOnTop
      property.<br>
      In part this was because it wasn't being checked in
      ServiceDialog.initPageDialog() - fixed<br>
      In other part it is because the attributes weren't propagated. The
      reason for this is<br>
      a bit lengthy to explain but the main thing to say is that we have
      an instance variable<br>
      attributes as well as a local variable in some places.<br>
      I didn't want to touch any code that even theoretically might
      affect 2D printing so<br>
      instead I cached the attribute as we do the owner id so it is
      passed on properly<br>
      Thanks to Kevin for spotting this problem<br>
      <br>
      <br>
      <div class="moz-cite-prefix">On 03/14/2017 09:02 AM, Sergey
        Bylokhov wrote:<br>
      </div>
      <blockquote
        cite="mid:BCA29947-C881-4A9B-861D-CE677C88FAA4@oracle.com"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=utf-8">
        Hi, Phil.
        <div class="">I have only two questions:</div>
        <div class="">  - Does it mean that we do not support "ontop"
          property via public API in idk?</div>
      </blockquote>
      <br>
      There is no API for the "alwaysOnTop" AWT property for the print
      dialogs.<br>
      I actually don't think it can be implemented for the windows
      native print controls.<br>
      There is an internal way to make an AWT window owner for the Swing
      print dialog<br>
      but nothing public and it doesn't help here as the owner is not an
      AWT window.<br>
      <br>
      <br>
      <blockquote
        cite="mid:BCA29947-C881-4A9B-861D-CE677C88FAA4@oracle.com"
        type="cite">
        <div class="">  - Probably the name should contain  «owner »
          instead of  «parent »?, But since this is not a public API I
          guess it is not an issue.</div>
      </blockquote>
      <br>
      I suppose that is more correct. Something to address if it ever
      makes its way into API or docs.<br>
      <br>
      -phil.<br>
      <br>
      <blockquote
        cite="mid:BCA29947-C881-4A9B-861D-CE677C88FAA4@oracle.com"
        type="cite">
        <div class=""><br class="">
          <div>
            <blockquote type="cite" class="">
              <div class=""><br class="">
              </div>
              <br class="Apple-interchange-newline">
              <div class="">
                <meta http-equiv="content-type" content="text/html;
                  charset=utf-8" class="">
                <div bgcolor="#FFFFFF" text="#000000" class=""> This has
                  an FX bug + webrev :<br class="">
                  <a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="https://bugs.openjdk.java.net/browse/JDK-8088395">https://bugs.openjdk.java.net/browse/JDK-8088395</a><br
  class="">
                  <a moz-do-not-send="true"
                    href="http://cr.openjdk.java.net/%7Eprr/8088395/index.html"
                    class="">http://cr.openjdk.java.net/~prr/8088395/index.html</a><br
  class="">
                  <br class="">
                  and also a JDK-side fix and webrev :-<br class="">
                  <a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="https://bugs.openjdk.java.net/browse/JDK-8176530">https://bugs.openjdk.java.net/browse/JDK-8176530</a><br
  class="">
                  <a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="http://cr.openjdk.java.net/%7Eprr/8176350/">http://cr.openjdk.java.net/~prr/8176350/</a><br
  class="">
                  <br class="">
                  The problem is FX modal dialogs are ignoring the
                  Window parameter.<br class="">
                  We can fix the problem with disabling the modal parent
                  on the FX side<br class="">
                  and that is why most files in FX are updated.<br
                    class="">
                  <br class="">
                  But it does not fix the "on top" issue which requires
                  the JDK fixes and<br class="">
                  to pass in the DialogOnTop private attribute.<br
                    class="">
                  The JDK code is there solely for FX and won't have any
                  visibility<br class="">
                  unless FX passes in the private attribute.<br class="">
                  <br class="">
                  On Linux it uses the standard AWT "always on top"
                  modality<br class="">
                  On windows it uses the HWND for the FX window and
                  windows native modality<br class="">
                  On Mac you won't see anything since Mac does this
                  automatically<br class="">
                  <br class="">
                  -phil.<br class="">
                </div>
              </div>
            </blockquote>
          </div>
          <br class="">
        </div>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic