mbien commented on code in PR #5161:
URL: https://github.com/apache/netbeans/pull/5161#discussion_r1059156786


##########
nb/ide.launcher/unix/netbeans:
##########
@@ -222,8 +222,29 @@ case "`uname`" in
         # information."
         # 
https://userbase.kde.org/KDE_System_Administration/Environment_Variables
         if [ ! -z "$KDE_FULL_SESSION" ] ; then
-            echo "Detected KDE; adding awt.useSystemAAFontSettings=on"
-            extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+            # Try to detect the correct subpixel antialiasing mode
+            # (https://github.com/apache/netbeans/issues/4228)
+
+            # See https://docs.gtk.org/gtk4/property.Settings.gtk-xft-rgba.html
+            # See 
https://docs.oracle.com/javase/7/docs/technotes/guides/2d/flags.html#aaFonts
+            case "`command xrdb -query 2> /dev/null | grep Xft.rgba | cut -d 
':' -f2 | xargs`" in
+                rgb)
+                    
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hrgb"
+                    ;;
+                bgr)
+                    
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_hbgr"
+                    ;;
+                vrgb)
+                    
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vrgb"
+                    ;;
+                vbgr)
+                    
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=lcd_vbgr"
+                    ;;
+                *)
+                    
extra_automatic_options="-J-Dawt.useSystemAAFontSettings=on"
+                    ;;
+            esac
+            echo "Detected KDE; use explicit setting for font antialiasing 
($extra_automatic_options)"

Review Comment:
   do I understand this issue correctly that:
    - JVM doesn't enable AA at all on some KDE systems, thats why NB began to 
set `-J-Dawt.useSystemAAFontSettings=on` only on KDE
    - on other KDE systems, `-J-Dawt.useSystemAAFontSettings=on` would pick the 
wrong mode, so the JVM does need even more help there, so we end up to 
configure everything font AA related on KDE
   
   If this works - great. However this probably should be upstreamed to OpenJDK 
if possible, looks like mode probing on KDE is lacking a bit behind. The Java 6 
doc already mentioned that KDE won't be detected, interesting that this didn't 
change since then :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to