Re: <Swing Dev> Questionable Rendering of Disabled Text

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Michael Dardis
On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:

> Hi All,
>
> Last couple of days I've been trying to root out this bug -
> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
> has resulted in poor looking rendering on my machine.
> It turns out that the cause of this behavior is that Swing tries to do
> its own magic disabled item rendering by turning the text white and
> shifting it a pixel in each direction. I have no doubt there was
> probably a good reason for this, however the file has remained
> unchanged since its initial import in 2007! (Maybe someone from Oracle
> can find out more)
> Removing this code (patch attached) makes disabled menu items render
> correctly in both light and dark GTK themes. Its completely trivial,
> but I've nonetheless provided the patch for context. There is also
> some adjacent code that references a metacity theme called "blueprint"
> that also seems pre 2007 era, but I've left that in as I have no idea
> of its context.
>
> Appreciate if this change / bug could be reviewed & discussed. In the
> meantime I will also forward it downstream to Ubuntu as this is where
> I encountered it / affects my usage.
>
> Thanks
> Michael
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Sergey Bylokhov
Hi, Michael.
It seems that the attached patch was removed from the email, can you
please provide a link to it or inline in email.
Thank you.

On 03/11/2017 03:09, Michael D wrote:

> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>> Hi All,
>>
>> Last couple of days I've been trying to root out this bug -
>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
>> has resulted in poor looking rendering on my machine.
>> It turns out that the cause of this behavior is that Swing tries to do
>> its own magic disabled item rendering by turning the text white and
>> shifting it a pixel in each direction. I have no doubt there was
>> probably a good reason for this, however the file has remained
>> unchanged since its initial import in 2007! (Maybe someone from Oracle
>> can find out more)
>> Removing this code (patch attached) makes disabled menu items render
>> correctly in both light and dark GTK themes. Its completely trivial,
>> but I've nonetheless provided the patch for context. There is also
>> some adjacent code that references a metacity theme called "blueprint"
>> that also seems pre 2007 era, but I've left that in as I have no idea
>> of its context.
>>
>> Appreciate if this change / bug could be reviewed & discussed. In the
>> meantime I will also forward it downstream to Ubuntu as this is where
>> I encountered it / affects my usage.
>>
>> Thanks
>> Michael


--
Best regards, Sergey.
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Phil Race
Yes these mailing lists strip attachements
So an in-line patch .. or send directly to one of us to host it for you
on cr.openjdk.java.net.

-phil.

On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:

> Hi, Michael.
> It seems that the attached patch was removed from the email, can you
> please provide a link to it or inline in email.
> Thank you.
>
> On 03/11/2017 03:09, Michael D wrote:
>> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>>> Hi All,
>>>
>>> Last couple of days I've been trying to root out this bug -
>>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
>>> has resulted in poor looking rendering on my machine.
>>> It turns out that the cause of this behavior is that Swing tries to do
>>> its own magic disabled item rendering by turning the text white and
>>> shifting it a pixel in each direction. I have no doubt there was
>>> probably a good reason for this, however the file has remained
>>> unchanged since its initial import in 2007! (Maybe someone from Oracle
>>> can find out more)
>>> Removing this code (patch attached) makes disabled menu items render
>>> correctly in both light and dark GTK themes. Its completely trivial,
>>> but I've nonetheless provided the patch for context. There is also
>>> some adjacent code that references a metacity theme called "blueprint"
>>> that also seems pre 2007 era, but I've left that in as I have no idea
>>> of its context.
>>>
>>> Appreciate if this change / bug could be reviewed & discussed. In the
>>> meantime I will also forward it downstream to Ubuntu as this is where
>>> I encountered it / affects my usage.
>>>
>>> Thanks
>>> Michael
>
>
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Michael Dardis
My bad,

Patch just looks like this (bit messy because of indent change).
Thanks
Michael




--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
@@ -46,35 +46,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
             // ignore this.
             return;
         }
-        int componentState = context.getComponentState();
-        if ((componentState & SynthConstants.DISABLED) ==
-                              SynthConstants.DISABLED){
-            if (!GTKLookAndFeel.is3()) {
-                Color orgColor = g.getColor();
-                g.setColor(context.getStyle().getColor(context,
-                        GTKColorType.WHITE));
-                x += 1;
-                y += 1;
-                super.paintText(context, g, text, x, y, mnemonicIndex);

-                g.setColor(orgColor);
-                x -= 1;
-                y -= 1;
-            }
-            super.paintText(context, g, text, x, y, mnemonicIndex);
-        }
-        else {
-            String themeName = GTKLookAndFeel.getGtkThemeName();
-            if (themeName != null && themeName.startsWith("blueprint") &&
-                shouldShadowText(context.getRegion(), componentState)) {
+        String themeName = GTKLookAndFeel.getGtkThemeName();
+        if (themeName != null && themeName.startsWith("blueprint") &&
+            shouldShadowText(context.getRegion(), componentState)) {

-                g.setColor(Color.BLACK);
-                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
-                g.setColor(Color.WHITE);
-            }
-
-            super.paintText(context, g, text, x, y, mnemonicIndex);
+            g.setColor(Color.BLACK);
+            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
+            g.setColor(Color.WHITE);
         }
+
+        super.paintText(context, g, text, x, y, mnemonicIndex);
     }

     /**

On 4 November 2017 at 06:39, Philip Race <[hidden email]> wrote:

> Yes these mailing lists strip attachements
> So an in-line patch .. or send directly to one of us to host it for you on
> cr.openjdk.java.net.
>
> -phil.
>
> On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:
>>
>> Hi, Michael.
>> It seems that the attached patch was removed from the email, can you
>> please provide a link to it or inline in email.
>> Thank you.
>>
>> On 03/11/2017 03:09, Michael D wrote:
>>>
>>> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>>>>
>>>> Hi All,
>>>>
>>>> Last couple of days I've been trying to root out this bug -
>>>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
>>>> has resulted in poor looking rendering on my machine.
>>>> It turns out that the cause of this behavior is that Swing tries to do
>>>> its own magic disabled item rendering by turning the text white and
>>>> shifting it a pixel in each direction. I have no doubt there was
>>>> probably a good reason for this, however the file has remained
>>>> unchanged since its initial import in 2007! (Maybe someone from Oracle
>>>> can find out more)
>>>> Removing this code (patch attached) makes disabled menu items render
>>>> correctly in both light and dark GTK themes. Its completely trivial,
>>>> but I've nonetheless provided the patch for context. There is also
>>>> some adjacent code that references a metacity theme called "blueprint"
>>>> that also seems pre 2007 era, but I've left that in as I have no idea
>>>> of its context.
>>>>
>>>> Appreciate if this change / bug could be reviewed & discussed. In the
>>>> meantime I will also forward it downstream to Ubuntu as this is where
>>>> I encountered it / affects my usage.
>>>>
>>>> Thanks
>>>> Michael
>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Michael Dardis
Apologies, noticed I broke the patch between testing and submission.

Correct and re-tested version


--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
@@ -47,34 +47,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
             return;
         }
         int componentState = context.getComponentState();
-        if ((componentState & SynthConstants.DISABLED) ==
-                              SynthConstants.DISABLED){
-            if (!GTKLookAndFeel.is3()) {
-                Color orgColor = g.getColor();
-                g.setColor(context.getStyle().getColor(context,
-                        GTKColorType.WHITE));
-                x += 1;
-                y += 1;
-                super.paintText(context, g, text, x, y, mnemonicIndex);

-                g.setColor(orgColor);
-                x -= 1;
-                y -= 1;
-            }
-            super.paintText(context, g, text, x, y, mnemonicIndex);
-        }
-        else {
-            String themeName = GTKLookAndFeel.getGtkThemeName();
-            if (themeName != null && themeName.startsWith("blueprint") &&
-                shouldShadowText(context.getRegion(), componentState)) {
+        String themeName = GTKLookAndFeel.getGtkThemeName();
+        if (themeName != null && themeName.startsWith("blueprint") &&
+            shouldShadowText(context.getRegion(), componentState)) {

-                g.setColor(Color.BLACK);
-                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
-                g.setColor(Color.WHITE);
-            }
-
-            super.paintText(context, g, text, x, y, mnemonicIndex);
+            g.setColor(Color.BLACK);
+            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
+            g.setColor(Color.WHITE);
         }
+
+        super.paintText(context, g, text, x, y, mnemonicIndex);
     }

     /**

On 4 November 2017 at 07:13, Michael D <[hidden email]> wrote:

> My bad,
>
> Patch just looks like this (bit messy because of indent change).
> Thanks
> Michael
>
>
>
>
> --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
> +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
> @@ -46,35 +46,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>              // ignore this.
>              return;
>          }
> -        int componentState = context.getComponentState();
> -        if ((componentState & SynthConstants.DISABLED) ==
> -                              SynthConstants.DISABLED){
> -            if (!GTKLookAndFeel.is3()) {
> -                Color orgColor = g.getColor();
> -                g.setColor(context.getStyle().getColor(context,
> -                        GTKColorType.WHITE));
> -                x += 1;
> -                y += 1;
> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>
> -                g.setColor(orgColor);
> -                x -= 1;
> -                y -= 1;
> -            }
> -            super.paintText(context, g, text, x, y, mnemonicIndex);
> -        }
> -        else {
> -            String themeName = GTKLookAndFeel.getGtkThemeName();
> -            if (themeName != null && themeName.startsWith("blueprint") &&
> -                shouldShadowText(context.getRegion(), componentState)) {
> +        String themeName = GTKLookAndFeel.getGtkThemeName();
> +        if (themeName != null && themeName.startsWith("blueprint") &&
> +            shouldShadowText(context.getRegion(), componentState)) {
>
> -                g.setColor(Color.BLACK);
> -                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
> -                g.setColor(Color.WHITE);
> -            }
> -
> -            super.paintText(context, g, text, x, y, mnemonicIndex);
> +            g.setColor(Color.BLACK);
> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
> +            g.setColor(Color.WHITE);
>          }
> +
> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>      }
>
>      /**
>
> On 4 November 2017 at 06:39, Philip Race <[hidden email]> wrote:
>> Yes these mailing lists strip attachements
>> So an in-line patch .. or send directly to one of us to host it for you on
>> cr.openjdk.java.net.
>>
>> -phil.
>>
>> On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:
>>>
>>> Hi, Michael.
>>> It seems that the attached patch was removed from the email, can you
>>> please provide a link to it or inline in email.
>>> Thank you.
>>>
>>> On 03/11/2017 03:09, Michael D wrote:
>>>>
>>>> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>>>>>
>>>>> Hi All,
>>>>>
>>>>> Last couple of days I've been trying to root out this bug -
>>>>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
>>>>> has resulted in poor looking rendering on my machine.
>>>>> It turns out that the cause of this behavior is that Swing tries to do
>>>>> its own magic disabled item rendering by turning the text white and
>>>>> shifting it a pixel in each direction. I have no doubt there was
>>>>> probably a good reason for this, however the file has remained
>>>>> unchanged since its initial import in 2007! (Maybe someone from Oracle
>>>>> can find out more)
>>>>> Removing this code (patch attached) makes disabled menu items render
>>>>> correctly in both light and dark GTK themes. Its completely trivial,
>>>>> but I've nonetheless provided the patch for context. There is also
>>>>> some adjacent code that references a metacity theme called "blueprint"
>>>>> that also seems pre 2007 era, but I've left that in as I have no idea
>>>>> of its context.
>>>>>
>>>>> Appreciate if this change / bug could be reviewed & discussed. In the
>>>>> meantime I will also forward it downstream to Ubuntu as this is where
>>>>> I encountered it / affects my usage.
>>>>>
>>>>> Thanks
>>>>> Michael
>>>
>>>
>>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Phil Race
Protocol is that there first be a bug report and then a "RFR" (request
for review) is sent
to the list referencing the bug + the fix

I have filed https://bugs.openjdk.java.net/browse/JDK-8191041

and verified that it works. So we can perhaps short-circuit that this
time .. but not next time ..

As to the blueprints path it looks safer to leave it since I don't know
how to test it
so I would be happy to commit the patch as is but I think this opinion
needs to be
reviewed by someone else on the list first ..

-phil.

On 11/03/2017 09:53 PM, Michael D wrote:

> Apologies, noticed I broke the patch between testing and submission.
>
> Correct and re-tested version
>
>
> --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
> +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
> @@ -47,34 +47,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>               return;
>           }
>           int componentState = context.getComponentState();
> -        if ((componentState & SynthConstants.DISABLED) ==
> -                              SynthConstants.DISABLED){
> -            if (!GTKLookAndFeel.is3()) {
> -                Color orgColor = g.getColor();
> -                g.setColor(context.getStyle().getColor(context,
> -                        GTKColorType.WHITE));
> -                x += 1;
> -                y += 1;
> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>
> -                g.setColor(orgColor);
> -                x -= 1;
> -                y -= 1;
> -            }
> -            super.paintText(context, g, text, x, y, mnemonicIndex);
> -        }
> -        else {
> -            String themeName = GTKLookAndFeel.getGtkThemeName();
> -            if (themeName != null && themeName.startsWith("blueprint") &&
> -                shouldShadowText(context.getRegion(), componentState)) {
> +        String themeName = GTKLookAndFeel.getGtkThemeName();
> +        if (themeName != null && themeName.startsWith("blueprint") &&
> +            shouldShadowText(context.getRegion(), componentState)) {
>
> -                g.setColor(Color.BLACK);
> -                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
> -                g.setColor(Color.WHITE);
> -            }
> -
> -            super.paintText(context, g, text, x, y, mnemonicIndex);
> +            g.setColor(Color.BLACK);
> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
> +            g.setColor(Color.WHITE);
>           }
> +
> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>       }
>
>       /**
>
> On 4 November 2017 at 07:13, Michael D <[hidden email]> wrote:
>> My bad,
>>
>> Patch just looks like this (bit messy because of indent change).
>> Thanks
>> Michael
>>
>>
>>
>>
>> --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>> +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>> @@ -46,35 +46,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>>               // ignore this.
>>               return;
>>           }
>> -        int componentState = context.getComponentState();
>> -        if ((componentState & SynthConstants.DISABLED) ==
>> -                              SynthConstants.DISABLED){
>> -            if (!GTKLookAndFeel.is3()) {
>> -                Color orgColor = g.getColor();
>> -                g.setColor(context.getStyle().getColor(context,
>> -                        GTKColorType.WHITE));
>> -                x += 1;
>> -                y += 1;
>> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>>
>> -                g.setColor(orgColor);
>> -                x -= 1;
>> -                y -= 1;
>> -            }
>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>> -        }
>> -        else {
>> -            String themeName = GTKLookAndFeel.getGtkThemeName();
>> -            if (themeName != null && themeName.startsWith("blueprint") &&
>> -                shouldShadowText(context.getRegion(), componentState)) {
>> +        String themeName = GTKLookAndFeel.getGtkThemeName();
>> +        if (themeName != null && themeName.startsWith("blueprint") &&
>> +            shouldShadowText(context.getRegion(), componentState)) {
>>
>> -                g.setColor(Color.BLACK);
>> -                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
>> -                g.setColor(Color.WHITE);
>> -            }
>> -
>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>> +            g.setColor(Color.BLACK);
>> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
>> +            g.setColor(Color.WHITE);
>>           }
>> +
>> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>>       }
>>
>>       /**
>>
>> On 4 November 2017 at 06:39, Philip Race <[hidden email]> wrote:
>>> Yes these mailing lists strip attachements
>>> So an in-line patch .. or send directly to one of us to host it for you on
>>> cr.openjdk.java.net.
>>>
>>> -phil.
>>>
>>> On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:
>>>> Hi, Michael.
>>>> It seems that the attached patch was removed from the email, can you
>>>> please provide a link to it or inline in email.
>>>> Thank you.
>>>>
>>>> On 03/11/2017 03:09, Michael D wrote:
>>>>> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>>>>>> Hi All,
>>>>>>
>>>>>> Last couple of days I've been trying to root out this bug -
>>>>>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
>>>>>> has resulted in poor looking rendering on my machine.
>>>>>> It turns out that the cause of this behavior is that Swing tries to do
>>>>>> its own magic disabled item rendering by turning the text white and
>>>>>> shifting it a pixel in each direction. I have no doubt there was
>>>>>> probably a good reason for this, however the file has remained
>>>>>> unchanged since its initial import in 2007! (Maybe someone from Oracle
>>>>>> can find out more)
>>>>>> Removing this code (patch attached) makes disabled menu items render
>>>>>> correctly in both light and dark GTK themes. Its completely trivial,
>>>>>> but I've nonetheless provided the patch for context. There is also
>>>>>> some adjacent code that references a metacity theme called "blueprint"
>>>>>> that also seems pre 2007 era, but I've left that in as I have no idea
>>>>>> of its context.
>>>>>>
>>>>>> Appreciate if this change / bug could be reviewed & discussed. In the
>>>>>> meantime I will also forward it downstream to Ubuntu as this is where
>>>>>> I encountered it / affects my usage.
>>>>>>
>>>>>> Thanks
>>>>>> Michael
>>>>
>>>>

Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Michael Dardis
Hi Phil,

Not an OpenJDk dev so unable to file bug reports or webrevs.

Thanks for looking at the patch and filing a report.

Michael 

On Fri, 10 Nov 2017 at 05:52, Phil Race <[hidden email]> wrote:
Protocol is that there first be a bug report and then a "RFR" (request
for review) is sent
to the list referencing the bug + the fix

I have filed https://bugs.openjdk.java.net/browse/JDK-8191041

and verified that it works. So we can perhaps short-circuit that this
time .. but not next time ..

As to the blueprints path it looks safer to leave it since I don't know
how to test it
so I would be happy to commit the patch as is but I think this opinion
needs to be
reviewed by someone else on the list first ..

-phil.

On 11/03/2017 09:53 PM, Michael D wrote:
> Apologies, noticed I broke the patch between testing and submission.
>
> Correct and re-tested version
>
>
> --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
> +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
> @@ -47,34 +47,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>               return;
>           }
>           int componentState = context.getComponentState();
> -        if ((componentState & SynthConstants.DISABLED) ==
> -                              SynthConstants.DISABLED){
> -            if (!GTKLookAndFeel.is3()) {
> -                Color orgColor = g.getColor();
> -                g.setColor(context.getStyle().getColor(context,
> -                        GTKColorType.WHITE));
> -                x += 1;
> -                y += 1;
> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>
> -                g.setColor(orgColor);
> -                x -= 1;
> -                y -= 1;
> -            }
> -            super.paintText(context, g, text, x, y, mnemonicIndex);
> -        }
> -        else {
> -            String themeName = GTKLookAndFeel.getGtkThemeName();
> -            if (themeName != null && themeName.startsWith("blueprint") &&
> -                shouldShadowText(context.getRegion(), componentState)) {
> +        String themeName = GTKLookAndFeel.getGtkThemeName();
> +        if (themeName != null && themeName.startsWith("blueprint") &&
> +            shouldShadowText(context.getRegion(), componentState)) {
>
> -                g.setColor(Color.BLACK);
> -                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
> -                g.setColor(Color.WHITE);
> -            }
> -
> -            super.paintText(context, g, text, x, y, mnemonicIndex);
> +            g.setColor(Color.BLACK);
> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
> +            g.setColor(Color.WHITE);
>           }
> +
> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>       }
>
>       /**
>
> On 4 November 2017 at 07:13, Michael D <[hidden email]> wrote:
>> My bad,
>>
>> Patch just looks like this (bit messy because of indent change).
>> Thanks
>> Michael
>>
>>
>>
>>
>> --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>> +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>> @@ -46,35 +46,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>>               // ignore this.
>>               return;
>>           }
>> -        int componentState = context.getComponentState();
>> -        if ((componentState & SynthConstants.DISABLED) ==
>> -                              SynthConstants.DISABLED){
>> -            if (!GTKLookAndFeel.is3()) {
>> -                Color orgColor = g.getColor();
>> -                g.setColor(context.getStyle().getColor(context,
>> -                        GTKColorType.WHITE));
>> -                x += 1;
>> -                y += 1;
>> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>>
>> -                g.setColor(orgColor);
>> -                x -= 1;
>> -                y -= 1;
>> -            }
>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>> -        }
>> -        else {
>> -            String themeName = GTKLookAndFeel.getGtkThemeName();
>> -            if (themeName != null && themeName.startsWith("blueprint") &&
>> -                shouldShadowText(context.getRegion(), componentState)) {
>> +        String themeName = GTKLookAndFeel.getGtkThemeName();
>> +        if (themeName != null && themeName.startsWith("blueprint") &&
>> +            shouldShadowText(context.getRegion(), componentState)) {
>>
>> -                g.setColor(Color.BLACK);
>> -                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
>> -                g.setColor(Color.WHITE);
>> -            }
>> -
>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>> +            g.setColor(Color.BLACK);
>> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
>> +            g.setColor(Color.WHITE);
>>           }
>> +
>> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>>       }
>>
>>       /**
>>
>> On 4 November 2017 at 06:39, Philip Race <[hidden email]> wrote:
>>> Yes these mailing lists strip attachements
>>> So an in-line patch .. or send directly to one of us to host it for you on
>>> cr.openjdk.java.net.
>>>
>>> -phil.
>>>
>>> On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:
>>>> Hi, Michael.
>>>> It seems that the attached patch was removed from the email, can you
>>>> please provide a link to it or inline in email.
>>>> Thank you.
>>>>
>>>> On 03/11/2017 03:09, Michael D wrote:
>>>>> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>>>>>> Hi All,
>>>>>>
>>>>>> Last couple of days I've been trying to root out this bug -
>>>>>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
>>>>>> has resulted in poor looking rendering on my machine.
>>>>>> It turns out that the cause of this behavior is that Swing tries to do
>>>>>> its own magic disabled item rendering by turning the text white and
>>>>>> shifting it a pixel in each direction. I have no doubt there was
>>>>>> probably a good reason for this, however the file has remained
>>>>>> unchanged since its initial import in 2007! (Maybe someone from Oracle
>>>>>> can find out more)
>>>>>> Removing this code (patch attached) makes disabled menu items render
>>>>>> correctly in both light and dark GTK themes. Its completely trivial,
>>>>>> but I've nonetheless provided the patch for context. There is also
>>>>>> some adjacent code that references a metacity theme called "blueprint"
>>>>>> that also seems pre 2007 era, but I've left that in as I have no idea
>>>>>> of its context.
>>>>>>
>>>>>> Appreciate if this change / bug could be reviewed & discussed. In the
>>>>>> meantime I will also forward it downstream to Ubuntu as this is where
>>>>>> I encountered it / affects my usage.
>>>>>>
>>>>>> Thanks
>>>>>> Michael
>>>>
>>>>

Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Phil Race
In reply to this post by Phil Race
No need this time but in future file it at http://bugreport.java.com/ ...
those go into the same JIRA instance as JBS and just get moved after
verification

-phil.

On 11/9/2017 1:35 PM, Michael D wrote:

> Hi Phil,
>
> Not an OpenJDk dev so unable to file bug reports or webrevs.
>
> Thanks for looking at the patch and filing a report.
>
> Michael
>
> On Fri, 10 Nov 2017 at 05:52, Phil Race <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Protocol is that there first be a bug report and then a "RFR" (request
>     for review) is sent
>     to the list referencing the bug + the fix
>
>     I have filed https://bugs.openjdk.java.net/browse/JDK-8191041
>
>     and verified that it works. So we can perhaps short-circuit that this
>     time .. but not next time ..
>
>     As to the blueprints path it looks safer to leave it since I don't
>     know
>     how to test it
>     so I would be happy to commit the patch as is but I think this opinion
>     needs to be
>     reviewed by someone else on the list first ..
>
>     -phil.
>
>     On 11/03/2017 09:53 PM, Michael D wrote:
>     > Apologies, noticed I broke the patch between testing and submission.
>     >
>     > Correct and re-tested version
>     >
>     >
>     > ---
>     a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>     > +++
>     b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>     > @@ -47,34 +47,17 @@ class GTKGraphicsUtils extends
>     SynthGraphicsUtils {
>     >               return;
>     >           }
>     >           int componentState = context.getComponentState();
>     > -        if ((componentState & SynthConstants.DISABLED) ==
>     > - SynthConstants.DISABLED){
>     > -            if (!GTKLookAndFeel.is3()) {
>     > -                Color orgColor = g.getColor();
>     > - g.setColor(context.getStyle().getColor(context,
>     > -                        GTKColorType.WHITE));
>     > -                x += 1;
>     > -                y += 1;
>     > -                super.paintText(context, g, text, x, y,
>     mnemonicIndex);
>     >
>     > -                g.setColor(orgColor);
>     > -                x -= 1;
>     > -                y -= 1;
>     > -            }
>     > -            super.paintText(context, g, text, x, y, mnemonicIndex);
>     > -        }
>     > -        else {
>     > -            String themeName = GTKLookAndFeel.getGtkThemeName();
>     > -            if (themeName != null &&
>     themeName.startsWith("blueprint") &&
>     > -                shouldShadowText(context.getRegion(),
>     componentState)) {
>     > +        String themeName = GTKLookAndFeel.getGtkThemeName();
>     > +        if (themeName != null &&
>     themeName.startsWith("blueprint") &&
>     > +            shouldShadowText(context.getRegion(),
>     componentState)) {
>     >
>     > -                g.setColor(Color.BLACK);
>     > -                super.paintText(context, g, text, x+1, y+1,
>     mnemonicIndex);
>     > -                g.setColor(Color.WHITE);
>     > -            }
>     > -
>     > -            super.paintText(context, g, text, x, y, mnemonicIndex);
>     > +            g.setColor(Color.BLACK);
>     > +            super.paintText(context, g, text, x+1, y+1,
>     mnemonicIndex);
>     > +            g.setColor(Color.WHITE);
>     >           }
>     > +
>     > +        super.paintText(context, g, text, x, y, mnemonicIndex);
>     >       }
>     >
>     >       /**
>     >
>     > On 4 November 2017 at 07:13, Michael D <[hidden email]
>     <mailto:[hidden email]>> wrote:
>     >> My bad,
>     >>
>     >> Patch just looks like this (bit messy because of indent change).
>     >> Thanks
>     >> Michael
>     >>
>     >>
>     >>
>     >>
>     >> ---
>     a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>     >> +++
>     b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>     >> @@ -46,35 +46,17 @@ class GTKGraphicsUtils extends
>     SynthGraphicsUtils {
>     >>               // ignore this.
>     >>               return;
>     >>           }
>     >> -        int componentState = context.getComponentState();
>     >> -        if ((componentState & SynthConstants.DISABLED) ==
>     >> - SynthConstants.DISABLED){
>     >> -            if (!GTKLookAndFeel.is3()) {
>     >> -                Color orgColor = g.getColor();
>     >> - g.setColor(context.getStyle().getColor(context,
>     >> -                        GTKColorType.WHITE));
>     >> -                x += 1;
>     >> -                y += 1;
>     >> -                super.paintText(context, g, text, x, y,
>     mnemonicIndex);
>     >>
>     >> -                g.setColor(orgColor);
>     >> -                x -= 1;
>     >> -                y -= 1;
>     >> -            }
>     >> -            super.paintText(context, g, text, x, y,
>     mnemonicIndex);
>     >> -        }
>     >> -        else {
>     >> -            String themeName = GTKLookAndFeel.getGtkThemeName();
>     >> -            if (themeName != null &&
>     themeName.startsWith("blueprint") &&
>     >> - shouldShadowText(context.getRegion(), componentState)) {
>     >> +        String themeName = GTKLookAndFeel.getGtkThemeName();
>     >> +        if (themeName != null &&
>     themeName.startsWith("blueprint") &&
>     >> +            shouldShadowText(context.getRegion(),
>     componentState)) {
>     >>
>     >> -                g.setColor(Color.BLACK);
>     >> -                super.paintText(context, g, text, x+1, y+1,
>     mnemonicIndex);
>     >> -                g.setColor(Color.WHITE);
>     >> -            }
>     >> -
>     >> -            super.paintText(context, g, text, x, y,
>     mnemonicIndex);
>     >> +            g.setColor(Color.BLACK);
>     >> +            super.paintText(context, g, text, x+1, y+1,
>     mnemonicIndex);
>     >> +            g.setColor(Color.WHITE);
>     >>           }
>     >> +
>     >> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>     >>       }
>     >>
>     >>       /**
>     >>
>     >> On 4 November 2017 at 06:39, Philip Race
>     <[hidden email] <mailto:[hidden email]>> wrote:
>     >>> Yes these mailing lists strip attachements
>     >>> So an in-line patch .. or send directly to one of us to host
>     it for you on
>     >>> cr.openjdk.java.net <http://cr.openjdk.java.net>.
>     >>>
>     >>> -phil.
>     >>>
>     >>> On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:
>     >>>> Hi, Michael.
>     >>>> It seems that the attached patch was removed from the email,
>     can you
>     >>>> please provide a link to it or inline in email.
>     >>>> Thank you.
>     >>>>
>     >>>> On 03/11/2017 03:09, Michael D wrote:
>     >>>>> On 3 November 2017 at 21:07, Michael D <[hidden email]
>     <mailto:[hidden email]>> wrote:
>     >>>>>> Hi All,
>     >>>>>>
>     >>>>>> Last couple of days I've been trying to root out this bug -
>     >>>>>>
>     https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 which
>     >>>>>> has resulted in poor looking rendering on my machine.
>     >>>>>> It turns out that the cause of this behavior is that Swing
>     tries to do
>     >>>>>> its own magic disabled item rendering by turning the text
>     white and
>     >>>>>> shifting it a pixel in each direction. I have no doubt
>     there was
>     >>>>>> probably a good reason for this, however the file has remained
>     >>>>>> unchanged since its initial import in 2007! (Maybe someone
>     from Oracle
>     >>>>>> can find out more)
>     >>>>>> Removing this code (patch attached) makes disabled menu
>     items render
>     >>>>>> correctly in both light and dark GTK themes. Its completely
>     trivial,
>     >>>>>> but I've nonetheless provided the patch for context. There
>     is also
>     >>>>>> some adjacent code that references a metacity theme called
>     "blueprint"
>     >>>>>> that also seems pre 2007 era, but I've left that in as I
>     have no idea
>     >>>>>> of its context.
>     >>>>>>
>     >>>>>> Appreciate if this change / bug could be reviewed &
>     discussed. In the
>     >>>>>> meantime I will also forward it downstream to Ubuntu as
>     this is where
>     >>>>>> I encountered it / affects my usage.
>     >>>>>>
>     >>>>>> Thanks
>     >>>>>> Michael
>     >>>>
>     >>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Semyon Sadetsky
In reply to this post by Phil Race
+1

--Semyon


On 11/09/2017 10:50 AM, Phil Race wrote:

> Protocol is that there first be a bug report and then a "RFR" (request
> for review) is sent
> to the list referencing the bug + the fix
>
> I have filed https://bugs.openjdk.java.net/browse/JDK-8191041
>
> and verified that it works. So we can perhaps short-circuit that this
> time .. but not next time ..
>
> As to the blueprints path it looks safer to leave it since I don't
> know how to test it
> so I would be happy to commit the patch as is but I think this opinion
> needs to be
> reviewed by someone else on the list first ..
>
> -phil.
>
> On 11/03/2017 09:53 PM, Michael D wrote:
>> Apologies, noticed I broke the patch between testing and submission.
>>
>> Correct and re-tested version
>>
>>
>> ---
>> a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>> +++
>> b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>> @@ -47,34 +47,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>>               return;
>>           }
>>           int componentState = context.getComponentState();
>> -        if ((componentState & SynthConstants.DISABLED) ==
>> -                              SynthConstants.DISABLED){
>> -            if (!GTKLookAndFeel.is3()) {
>> -                Color orgColor = g.getColor();
>> -                g.setColor(context.getStyle().getColor(context,
>> -                        GTKColorType.WHITE));
>> -                x += 1;
>> -                y += 1;
>> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>>
>> -                g.setColor(orgColor);
>> -                x -= 1;
>> -                y -= 1;
>> -            }
>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>> -        }
>> -        else {
>> -            String themeName = GTKLookAndFeel.getGtkThemeName();
>> -            if (themeName != null &&
>> themeName.startsWith("blueprint") &&
>> -                shouldShadowText(context.getRegion(),
>> componentState)) {
>> +        String themeName = GTKLookAndFeel.getGtkThemeName();
>> +        if (themeName != null && themeName.startsWith("blueprint") &&
>> +            shouldShadowText(context.getRegion(), componentState)) {
>>
>> -                g.setColor(Color.BLACK);
>> -                super.paintText(context, g, text, x+1, y+1,
>> mnemonicIndex);
>> -                g.setColor(Color.WHITE);
>> -            }
>> -
>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>> +            g.setColor(Color.BLACK);
>> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
>> +            g.setColor(Color.WHITE);
>>           }
>> +
>> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>>       }
>>
>>       /**
>>
>> On 4 November 2017 at 07:13, Michael D <[hidden email]> wrote:
>>> My bad,
>>>
>>> Patch just looks like this (bit messy because of indent change).
>>> Thanks
>>> Michael
>>>
>>>
>>>
>>>
>>> ---
>>> a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>>> +++
>>> b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>>> @@ -46,35 +46,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>>>               // ignore this.
>>>               return;
>>>           }
>>> -        int componentState = context.getComponentState();
>>> -        if ((componentState & SynthConstants.DISABLED) ==
>>> -                              SynthConstants.DISABLED){
>>> -            if (!GTKLookAndFeel.is3()) {
>>> -                Color orgColor = g.getColor();
>>> - g.setColor(context.getStyle().getColor(context,
>>> -                        GTKColorType.WHITE));
>>> -                x += 1;
>>> -                y += 1;
>>> -                super.paintText(context, g, text, x, y,
>>> mnemonicIndex);
>>>
>>> -                g.setColor(orgColor);
>>> -                x -= 1;
>>> -                y -= 1;
>>> -            }
>>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>>> -        }
>>> -        else {
>>> -            String themeName = GTKLookAndFeel.getGtkThemeName();
>>> -            if (themeName != null &&
>>> themeName.startsWith("blueprint") &&
>>> -                shouldShadowText(context.getRegion(),
>>> componentState)) {
>>> +        String themeName = GTKLookAndFeel.getGtkThemeName();
>>> +        if (themeName != null && themeName.startsWith("blueprint") &&
>>> +            shouldShadowText(context.getRegion(), componentState)) {
>>>
>>> -                g.setColor(Color.BLACK);
>>> -                super.paintText(context, g, text, x+1, y+1,
>>> mnemonicIndex);
>>> -                g.setColor(Color.WHITE);
>>> -            }
>>> -
>>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>>> +            g.setColor(Color.BLACK);
>>> +            super.paintText(context, g, text, x+1, y+1,
>>> mnemonicIndex);
>>> +            g.setColor(Color.WHITE);
>>>           }
>>> +
>>> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>>>       }
>>>
>>>       /**
>>>
>>> On 4 November 2017 at 06:39, Philip Race <[hidden email]>
>>> wrote:
>>>> Yes these mailing lists strip attachements
>>>> So an in-line patch .. or send directly to one of us to host it for
>>>> you on
>>>> cr.openjdk.java.net.
>>>>
>>>> -phil.
>>>>
>>>> On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:
>>>>> Hi, Michael.
>>>>> It seems that the attached patch was removed from the email, can you
>>>>> please provide a link to it or inline in email.
>>>>> Thank you.
>>>>>
>>>>> On 03/11/2017 03:09, Michael D wrote:
>>>>>> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>>>>>>> Hi All,
>>>>>>>
>>>>>>> Last couple of days I've been trying to root out this bug -
>>>>>>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558 
>>>>>>> which
>>>>>>> has resulted in poor looking rendering on my machine.
>>>>>>> It turns out that the cause of this behavior is that Swing tries
>>>>>>> to do
>>>>>>> its own magic disabled item rendering by turning the text white and
>>>>>>> shifting it a pixel in each direction. I have no doubt there was
>>>>>>> probably a good reason for this, however the file has remained
>>>>>>> unchanged since its initial import in 2007! (Maybe someone from
>>>>>>> Oracle
>>>>>>> can find out more)
>>>>>>> Removing this code (patch attached) makes disabled menu items
>>>>>>> render
>>>>>>> correctly in both light and dark GTK themes. Its completely
>>>>>>> trivial,
>>>>>>> but I've nonetheless provided the patch for context. There is also
>>>>>>> some adjacent code that references a metacity theme called
>>>>>>> "blueprint"
>>>>>>> that also seems pre 2007 era, but I've left that in as I have no
>>>>>>> idea
>>>>>>> of its context.
>>>>>>>
>>>>>>> Appreciate if this change / bug could be reviewed & discussed.
>>>>>>> In the
>>>>>>> meantime I will also forward it downstream to Ubuntu as this is
>>>>>>> where
>>>>>>> I encountered it / affects my usage.
>>>>>>>
>>>>>>> Thanks
>>>>>>> Michael
>>>>>
>>>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> Questionable Rendering of Disabled Text

Michael Dardis
Hi Phil, Semyon,

Didn't see this land originally.
Thanks for the sponsorship.

Will try and get this applied to downstream Ubuntu builds.

Thanks
Michael

On 14 November 2017 at 08:20, Semyon Sadetsky
<[hidden email]> wrote:

> +1
>
> --Semyon
>
>
> On 11/09/2017 10:50 AM, Phil Race wrote:
>>
>> Protocol is that there first be a bug report and then a "RFR" (request for
>> review) is sent
>> to the list referencing the bug + the fix
>>
>> I have filed https://bugs.openjdk.java.net/browse/JDK-8191041
>>
>> and verified that it works. So we can perhaps short-circuit that this time
>> .. but not next time ..
>>
>> As to the blueprints path it looks safer to leave it since I don't know
>> how to test it
>> so I would be happy to commit the patch as is but I think this opinion
>> needs to be
>> reviewed by someone else on the list first ..
>>
>> -phil.
>>
>> On 11/03/2017 09:53 PM, Michael D wrote:
>>>
>>> Apologies, noticed I broke the patch between testing and submission.
>>>
>>> Correct and re-tested version
>>>
>>>
>>> ---
>>> a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>>> +++
>>> b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>>> @@ -47,34 +47,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>>>               return;
>>>           }
>>>           int componentState = context.getComponentState();
>>> -        if ((componentState & SynthConstants.DISABLED) ==
>>> -                              SynthConstants.DISABLED){
>>> -            if (!GTKLookAndFeel.is3()) {
>>> -                Color orgColor = g.getColor();
>>> -                g.setColor(context.getStyle().getColor(context,
>>> -                        GTKColorType.WHITE));
>>> -                x += 1;
>>> -                y += 1;
>>> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>>>
>>> -                g.setColor(orgColor);
>>> -                x -= 1;
>>> -                y -= 1;
>>> -            }
>>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>>> -        }
>>> -        else {
>>> -            String themeName = GTKLookAndFeel.getGtkThemeName();
>>> -            if (themeName != null && themeName.startsWith("blueprint")
>>> &&
>>> -                shouldShadowText(context.getRegion(), componentState)) {
>>> +        String themeName = GTKLookAndFeel.getGtkThemeName();
>>> +        if (themeName != null && themeName.startsWith("blueprint") &&
>>> +            shouldShadowText(context.getRegion(), componentState)) {
>>>
>>> -                g.setColor(Color.BLACK);
>>> -                super.paintText(context, g, text, x+1, y+1,
>>> mnemonicIndex);
>>> -                g.setColor(Color.WHITE);
>>> -            }
>>> -
>>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>>> +            g.setColor(Color.BLACK);
>>> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
>>> +            g.setColor(Color.WHITE);
>>>           }
>>> +
>>> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>>>       }
>>>
>>>       /**
>>>
>>> On 4 November 2017 at 07:13, Michael D <[hidden email]> wrote:
>>>>
>>>> My bad,
>>>>
>>>> Patch just looks like this (bit messy because of indent change).
>>>> Thanks
>>>> Michael
>>>>
>>>>
>>>>
>>>>
>>>> ---
>>>> a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>>>> +++
>>>> b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
>>>> @@ -46,35 +46,17 @@ class GTKGraphicsUtils extends SynthGraphicsUtils {
>>>>               // ignore this.
>>>>               return;
>>>>           }
>>>> -        int componentState = context.getComponentState();
>>>> -        if ((componentState & SynthConstants.DISABLED) ==
>>>> -                              SynthConstants.DISABLED){
>>>> -            if (!GTKLookAndFeel.is3()) {
>>>> -                Color orgColor = g.getColor();
>>>> - g.setColor(context.getStyle().getColor(context,
>>>> -                        GTKColorType.WHITE));
>>>> -                x += 1;
>>>> -                y += 1;
>>>> -                super.paintText(context, g, text, x, y, mnemonicIndex);
>>>>
>>>> -                g.setColor(orgColor);
>>>> -                x -= 1;
>>>> -                y -= 1;
>>>> -            }
>>>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>>>> -        }
>>>> -        else {
>>>> -            String themeName = GTKLookAndFeel.getGtkThemeName();
>>>> -            if (themeName != null && themeName.startsWith("blueprint")
>>>> &&
>>>> -                shouldShadowText(context.getRegion(), componentState))
>>>> {
>>>> +        String themeName = GTKLookAndFeel.getGtkThemeName();
>>>> +        if (themeName != null && themeName.startsWith("blueprint") &&
>>>> +            shouldShadowText(context.getRegion(), componentState)) {
>>>>
>>>> -                g.setColor(Color.BLACK);
>>>> -                super.paintText(context, g, text, x+1, y+1,
>>>> mnemonicIndex);
>>>> -                g.setColor(Color.WHITE);
>>>> -            }
>>>> -
>>>> -            super.paintText(context, g, text, x, y, mnemonicIndex);
>>>> +            g.setColor(Color.BLACK);
>>>> +            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
>>>> +            g.setColor(Color.WHITE);
>>>>           }
>>>> +
>>>> +        super.paintText(context, g, text, x, y, mnemonicIndex);
>>>>       }
>>>>
>>>>       /**
>>>>
>>>> On 4 November 2017 at 06:39, Philip Race <[hidden email]> wrote:
>>>>>
>>>>> Yes these mailing lists strip attachements
>>>>> So an in-line patch .. or send directly to one of us to host it for you
>>>>> on
>>>>> cr.openjdk.java.net.
>>>>>
>>>>> -phil.
>>>>>
>>>>> On 11/3/17, 12:34 PM, Sergey Bylokhov wrote:
>>>>>>
>>>>>> Hi, Michael.
>>>>>> It seems that the attached patch was removed from the email, can you
>>>>>> please provide a link to it or inline in email.
>>>>>> Thank you.
>>>>>>
>>>>>> On 03/11/2017 03:09, Michael D wrote:
>>>>>>>
>>>>>>> On 3 November 2017 at 21:07, Michael D <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>> Last couple of days I've been trying to root out this bug -
>>>>>>>> https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1729558
>>>>>>>> which
>>>>>>>> has resulted in poor looking rendering on my machine.
>>>>>>>> It turns out that the cause of this behavior is that Swing tries to
>>>>>>>> do
>>>>>>>> its own magic disabled item rendering by turning the text white and
>>>>>>>> shifting it a pixel in each direction. I have no doubt there was
>>>>>>>> probably a good reason for this, however the file has remained
>>>>>>>> unchanged since its initial import in 2007! (Maybe someone from
>>>>>>>> Oracle
>>>>>>>> can find out more)
>>>>>>>> Removing this code (patch attached) makes disabled menu items render
>>>>>>>> correctly in both light and dark GTK themes. Its completely trivial,
>>>>>>>> but I've nonetheless provided the patch for context. There is also
>>>>>>>> some adjacent code that references a metacity theme called
>>>>>>>> "blueprint"
>>>>>>>> that also seems pre 2007 era, but I've left that in as I have no
>>>>>>>> idea
>>>>>>>> of its context.
>>>>>>>>
>>>>>>>> Appreciate if this change / bug could be reviewed & discussed. In
>>>>>>>> the
>>>>>>>> meantime I will also forward it downstream to Ubuntu as this is
>>>>>>>> where
>>>>>>>> I encountered it / affects my usage.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Michael
>>>>>>
>>>>>>
>>>>>>
>>
>