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