From adb82212627146f0f77b66b999c60c4514164cbb Mon Sep 17 00:00:00 2001 From: Kyle Feuz Date: Tue, 10 Jun 2014 01:01:37 -0700 Subject: [PATCH] Fixes Issue #2534 by setting the Application name for Linux --- .../processing/app/platform/LinuxPlatform.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/src/processing/app/platform/LinuxPlatform.java b/app/src/processing/app/platform/LinuxPlatform.java index 8e9ee7c71..8360cc49a 100644 --- a/app/src/processing/app/platform/LinuxPlatform.java +++ b/app/src/processing/app/platform/LinuxPlatform.java @@ -23,6 +23,7 @@ package processing.app.platform; import java.io.File; +import java.awt.Toolkit; import processing.app.Base; import processing.app.Platform; @@ -47,6 +48,20 @@ public class LinuxPlatform extends Platform { "placement. For more background, please read the wiki:\n" + "http://wiki.processing.org/w/Supported_Platforms#Linux", null); } + //Set x11 WM_CLASS property which is + //used as the application name by Gnome3 + //and other window managers + try{ + Toolkit xToolkit = Toolkit.getDefaultToolkit(); + java.lang.reflect.Field awtAppClassNameField = + xToolkit.getClass().getDeclaredField("awtAppClassName"); + awtAppClassNameField.setAccessible(true); + awtAppClassNameField.set(xToolkit, "Processing"); + } + catch(Exception e){ + //In case the implementation details change... + e.printStackTrace(); + } }