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

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray icon color is not green
From:       Sergey Bylokhov <sergey.bylokhov () oracle ! com>
Date:       2017-08-18 23:24:52
Message-ID: 7b6ab1d3-1e2a-42d9-ba8d-33c4fe0aff8a () default
[Download RAW message or body]

Hi, Shashi. 
The config event is auto-generated during the build: 
/support/gensrc/java.desktop/sun/awt/X11/XConfigureEvent.java 
Can you please check that the size which we get from the native is properly scaled, \
also make sure that the native size is not "leaked" outside of the peer(for example \
via getBounds() method), or atleast it will be expected by the caller. 

----- shashidhara.veerabhadraiah@oracle.com wrote: 
> RE: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray icon color is not green 


Hi Sergey, I have updated the Webrev. Please review this: 

http://cr.openjdk.java.net/~pkbalakr/shashi/8169044/webrev.01/ 



I have made the code updates uniform in the file to take the ' scaled ' size of the \
icon instead of the ' hardcoded ' size earlier. 

Another point is that am not able to find the source code for the XConfigureEvent( \
which captures the window configuration attributes of the tray icon window in this \
case ) and hence am not sure about the configuration of the XWindow configuratio n \
response ( of the tray icon ) is scaled or not. If it i s not scaled it may require \
updates for the metacity window manager specific code to adjust the window \
configuration of the tray icon ( because metacity WM provides rectangular window \
instead of a square w in dow ) . 

Thanks and regards, 

Shashi 



-----Original Message----- 
> From: Sergey Bylokhov 
> Sent: Wednesday, August 2, 2017 2:45 AM 
> To: Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah@oracle.com> 
> Cc: awt-dev@openjdk.java.net; 2d-dev@openjdk.java.net; Jim Graham \
>                 <james.graham@oracle.com> 
> Subject: Re: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray ic on color is not green 

Hi, Shashi. 

As far as I understand the "width/height" in the IconCanvas is a size of the TrayIcon \
in pixels. So on the normal screen it is should be 24(TRAY_ICON_WIDTH) pixels and on \
a HiDPI screen it should be 24*ScreenScale. The IconCanvas.width/height fields shoul \
d reflect this size. 

I am not sure but it looks like the current fix changes the "size" of the frame just \
for rendering(so we select HiDPI image) but did not change the size of the frame. So \
we draw the HiDPI image to non-HiDPI embedded frame. 

----- shash idhara.veerabhadraiah@oracle.com wrote: 

> Yes Jim. Per the current code base, it is defaulted to default screen. 

> 

> To have the same tray icon being represented on multiple task bars 

> would require updates to XSystemTrayPeer.java to replicate the mess age 

> being sent to X11 to add a new tray icon for a particular 

> screen(Currently it is done only for the default screen). The current 

> X11 tray system uses XEMBED protocol to add system tray icons. 

> Currently the screen is set to 0 which I think wou ld refer to default 

> screen and hence it adds tray icons only to the default screen. The 

> X11 property '_NET_SYSTEM_TRAY_S[SCREEN_NUMBER]' allows access to the 

> system tray of screen 'SCREEN_ NUMBER '. So we may need to use such 

> mechanism to add the tray icon onto different screens. This may be 

> different for windows and mac but will have a similar mechanism. 

> 

> Thanks and regards, 

> Shashi 

> 

> -----Original Message----- 

> From: Jim Graham 

> Sent: Tuesday, August 1, 2017 2: 14 AM 

> To: Shashidhara Veerabhadraiah 

> < shashidhara.veerabhadraiah@oracle.com >; awt-dev@openjdk.java.net ; 

> 2d-dev < 2d-dev@openjdk.java.net > 

> Subject: Re: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray icon color is 

> not green 

> 

> Will the tray icon ca nvas always be on the default screen? I believe 

> the latest MacOS and Win10 both allow menu bars and task bars on all 

> monitors. Linux may not be far behind... 

> 

> ...jim 

> 

> On 7/30/17 11:59 PM, Shashidhara Veerabhadraiah wrote: 

> > Hi, Kindly review a fix for JDK-8169044 where the non hi dpi icon 

> was 

> > picked among the icon set of hi dpi and a non hi dpi icons for a hi 

> dpi display screen. 

> > 

> > Issue: The non hi dpi icon is red in color (and hi dpi icon is green 

> 

> > in color) and was getting picked up among the set for a hi dpi 

> display screen as shown below in the picture: 

> > 

> > Solution and fix: The icon's buffered images are not subjected to 

> the 

> > scaling because of the hi dpi screen. Hence, the default non hi dpi 

> 

> > icon was getting picked up for rendering the tray icon. Now the 

> source 

> > code modified to apply necessary transformations to the 

> bufferedimages to get the default icon based on the default display 

> screen. Below is the output aft er the fix: 

> > 

> > Bug: https://bugs.openjdk.java.net/browse/JDK-8169044 

> > 

> > Webrev: 

> http://cr.openjdk.java.net/~pkbalakr/shashi/8169044/webrev.00/ 

> > 

> > Thanks and regards, 

> > 

> > Shashi 

> > 


[Attachment #3 (text/html)]

<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div \
style='font-family: Times New Roman; font-size: 12pt; color: #000000'>Hi, \
Shashi.<br>The config event is auto-generated during&nbsp; the \
build:<br>/support/gensrc/java.desktop/sun/awt/X11/XConfigureEvent.java<br>Can you \
please check that the size which we get from the native is properly scaled, also make \
sure that the native size is not "leaked" outside of the peer(for example via \
getBounds() method), or atleast it will be expected by the caller.<br><br>----- \
shashidhara.veerabhadraiah@oracle.com wrote: <br>&gt; 




<title>RE: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray icon color is not \
green</title>

<div>
<!-- Converted from text/rtf format -->

<p dir="LTR"><span lang="en-us"><font face="Calibri">Hi Sergey, I</font><font \
face="Calibri"> have updated the</font> <font face="Calibri">Webrev.</font><font \
face="Calibri"> Please review this:</font></span></p>

<p dir="LTR"><span lang="en-us"></span><a \
href="http://cr.openjdk.java.net/~pkbalakr/shashi/8169044/webrev.01/" \
target="_blank"><span lang="en-us"><u><font face="Calibri" \
color="#0563C1">http://cr.openjdk.java.net/~pkbalakr/shashi/8169044/webrev.01/</font></u></span><span \
lang="en-us"></span></a><span lang="en-us"></span></p>

<p dir="LTR"><span lang="en-us"></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">I have made the code updates \
uniform in the file to take the</font> <font face="Calibri">'</font><font \
face="Calibri">scaled</font><font face="Calibri">'</font><font face="Calibri"> size \
of the icon instead of the '</font></span><span lang="en-us"><font \
face="Calibri">hardcoded</font></span><span lang="en-us"><font \
face="Calibri">'</font></span><span lang="en-us"><font face="Calibri"> size \
earlier.</font><font face="Calibri"></font></span><span lang="en-us"> </span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">Another point is \
that</font></span><span lang="en-us"> <font face="Calibri">am</font> <font \
face="Calibri">not able to find the source code for the XConfigureEvent(</font><font \
face="Calibri">which captures the window configuration attributes of \
the</font></span><span lang="en-us"> <font face="Calibri">tray icon window in this \
case</font></span><span lang="en-us"><font face="Calibri">)</font></span><span \
lang="en-us"><font face="Calibri"> and hence am not sure about the configuration of \
the XWindow</font></span><span lang="en-us"><font face="Calibri"> \
configuratio</font><font face="Calibri">n response</font></span><span lang="en-us"> \
<font face="Calibri">(</font><font face="Calibri">of the tray icon</font><font \
face="Calibri">)</font></span><span lang="en-us"><font face="Calibri"> is scaled or \
not.</font> <font face="Calibri">If it i</font></span><span lang="en-us"><font \
face="Calibri">s not scaled it may require updates for the metacity window manager \
specific code to adjust the</font> <font face="Calibri">window \
configuration</font><font face="Calibri"> of the</font><font face="Calibri"> tray \
icon</font></span><span lang="en-us"><font face="Calibri">(</font><font \
face="Calibri">because metacity WM provides rectangular window instead of a square \
w</font><font face="Calibri">in</font></span><span lang="en-us"><font \
face="Calibri">dow</font></span><span lang="en-us"><font \
face="Calibri">)</font></span><span lang="en-us">.</span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">Thanks and \
regards,</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">Shashi</font></span><span \
lang="en-us"></span></p>

<p dir="LTR"><span lang="en-us"></span><a name=""><span lang="en-us"></span></a></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">-----Original \
Message-----<br>&gt;  </font><font face="Calibri">From:</font><font face="Calibri"> \
Sergey Bylokhov<br>&gt;  </font><font face="Calibri">Sent:</font><font \
face="Calibri"></font> <font face="Calibri">Wednesday, August 2, 2017 2:45 AM<br>&gt; \
 </font><font face="Calibri">To:</font><font face="Calibri"> Shashidhara \
Veerabhadraiah &lt;shashidhara.veerabhadraiah@oracle.com&gt;<br>&gt;  </font><font \
face="Calibri">Cc:</font><font face="Calibri"> awt-dev@openjdk.java.net; \
2d-dev@openjdk.java.net; Jim Graham &lt;james.graham@oracle.com&gt;<br>&gt;  \
</font><font face="Calibri">Subject:</font><font face="Calibri"> Re: [OpenJDK 2D-Dev] \
[10] JDK-8169044: The tray ic</font><font face="Calibri">on color is not \
green</font></span><span lang="en-us"></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">Hi, Shashi.</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">As far as I understand the \
"width/height" in the IconCanvas is a size of the TrayIcon in pixels. So on the \
normal screen it is should be 24(TRAY_ICON_WIDTH) pixels and on a HiDPI screen it \
should be 24*ScreenScale. The IconCanvas.width/height fields shoul</font><font \
face="Calibri">d</font><font face="Calibri"> reflect this size.</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">I am not sure but it looks like \
the current fix changes the "size" of the frame just for rendering(so we select HiDPI \
image) but did not change the size of the frame. So we draw the HiDPI image to \
non-HiDPI embedded frame.</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">-----</font></span><span \
lang="en-us"> </span><a href="mailto:shashidhara.veerabhadraiah@oracle.com" \
target="_blank"><span lang="en-us"><font face="Calibri">shash</font><font \
face="Calibri">idhara.veerabhadraiah@oracle.com</font></span><span \
lang="en-us"></span></a><span lang="en-us"><font face="Calibri"> \
wrote:</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; Yes Jim. Per the current \
code base, it is defaulted to default screen.</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; To have the same tray icon \
being represented on multiple task bars </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; would require updates to \
XSystemTrayPeer.java to replicate the mess</font><font face="Calibri">age \
</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; being sent to X11 to add a \
new tray icon for a particular </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; screen(Currently it is done \
only for the default screen). The current</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; X11 tray system uses XEMBED \
protocol to add system tray icons. </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; Currently the screen is set \
to 0 which I think wou</font><font face="Calibri">ld refer to default \
</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; screen and hence it adds \
tray icons only to the default screen. The</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; X11 property \
'_NET_SYSTEM_TRAY_S[SCREEN_NUMBER]' allows access to the </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; system tray of screen \
'SCREEN_ NUMBER '. So we may need to use such </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; mechanism to add the tray \
icon onto different screens. This may be </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; different for windows and \
mac but will have a similar mechanism.</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; Thanks and \
regards,</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; Shashi</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; -----Original \
Message-----</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; From: Jim \
Graham</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; Sent: Tuesday, August 1, \
2017 2:</font><font face="Calibri">14 AM</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; To: Shashidhara \
Veerabhadraiah</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &lt;</font></span><span \
lang="en-us"></span><a href="mailto:shashidhara.veerabhadraiah@oracle.com" \
target="_blank"><span lang="en-us"><font \
face="Calibri">shashidhara.veerabhadraiah@oracle.com</font></span><span \
lang="en-us"></span></a><span lang="en-us"><font \
face="Calibri">&gt;;</font></span><span lang="en-us"> </span><a \
href="mailto:awt-dev@openjdk.java.net" target="_blank"><span lang="en-us"><font \
face="Calibri">awt-dev@openjdk.java.net</font></span><span \
lang="en-us"></span></a><span lang="en-us"><font face="Calibri">; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; 2d-dev \
&lt;</font></span><span lang="en-us"></span><a href="mailto:2d-dev@openjdk.java.net" \
target="_blank"><span lang="en-us"><font \
face="Calibri">2d-dev@openjdk.java.net</font></span><span \
lang="en-us"></span></a><span lang="en-us"><font \
face="Calibri">&gt;</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; Subject: Re: [OpenJDK \
2D-Dev] [10] JDK-8169044: The tray icon color is </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; not green</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; Will the tray icon \
ca</font><font face="Calibri">nvas always be on the default screen?&nbsp; I believe \
</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; the latest MacOS and Win10 \
both allow menu bars and task bars on all </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; monitors.&nbsp; Linux may \
not be far behind...</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...jim</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; On 7/30/17 11:59 PM, \
Shashidhara Veerabhadraiah wrote:</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; Hi, Kindly</font> \
<font face="Calibri">review a fix for JDK-8169044 where the non hi dpi \
icon</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; was</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; picked among the icon \
set of hi dpi and a non hi dpi icons for a hi</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; dpi display \
screen.</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; Issue: The non hi dpi \
icon is red in color (and hi dpi icon is green</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; in color) and was \
getting picked up among the set for a hi dpi</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; display screen as shown \
below in the picture:</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; Solution and fix: The \
icon's buffered images are not subjected to</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; the</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; scaling because of the \
hi dpi screen. Hence, the default</font><font face="Calibri"> non hi \
dpi</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; icon was getting \
picked up for rendering the tray icon. Now the</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; source</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; code modified to apply \
necessary transformations to the</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; bufferedimages to get the \
default icon based on the default display </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; screen. Below is the output \
aft</font><font face="Calibri">er the fix:</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; \
Bug:</font></span><span lang="en-us"> </span><a \
href="https://bugs.openjdk.java.net/browse/JDK-8169044" target="_blank"><span \
lang="en-us"><font face="Calibri">https://bugs.openjdk.java.net/browse/JDK-8169044</font></span><span \
lang="en-us"></span></a><span lang="en-us"></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; \
Webrev:</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt;</font></span><span \
lang="en-us"> </span><a \
href="http://cr.openjdk.java.net/~pkbalakr/shashi/8169044/webrev.00/" \
target="_blank"><span lang="en-us"><font \
face="Calibri">http://cr.openjdk.java.net/~pkbalakr/shashi/8169044/webrev.00/</font></span><span \
lang="en-us"></span></a><span lang="en-us"></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; Thanks and \
regards,</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; </font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt; \
Shashi</font></span></p>

<p dir="LTR"><span lang="en-us"><font face="Calibri">&gt; &gt;</font></span></p>

<p dir="LTR"><span lang="en-us"></span></p>

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



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

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