[10] JDK-8169044: The tray icon color is not green

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[10] JDK-8169044: The tray icon color is not green

shashi

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 after 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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [10] JDK-8169044: The tray icon color is not green

Jim Graham-5
Will the tray icon canvas 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 after 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
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [10] JDK-8169044: The tray icon color is not green

shashi
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 message 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 would 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 <[hidden email]>; [hidden email]; 2d-dev <[hidden email]>
Subject: Re: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray icon color is not green

Will the tray icon canvas 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 after 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
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [10] JDK-8169044: The tray icon color is not green

shashi
In reply to this post by shashi
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 configuration response (of the tray icon) is scaled or not. If it is 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 window).

Thanks and regards,

Shashi

-----Original Message-----
From: Sergey Bylokhov
Sent: Wednesday, August 2, 2017 2:45 AM
To: Shashidhara Veerabhadraiah <[hidden email]>
Cc: [hidden email]; [hidden email]; Jim Graham <[hidden email]>
Subject: Re: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray icon 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 should 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.

----- [hidden email] 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 message

> 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 would 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

> <[hidden email]>; [hidden email];

> 2d-dev <[hidden email]>

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

> not green

>

> Will the tray icon canvas 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 after 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

> >

Loading...