This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hello, thanks for the wonderful IDE! One issue however is that NetBeans does not provide a useful WM_CLASS property on Linux, which docks and other tools use to match processes to windows. You can test this by running something like "xprop | grep WM_CLASS", which will turn your cursor into a cross, waiting for a click on a window, such as NetBeans: $ xprop | grep WM_CLASS WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "java-lang-Thread" so, it is only possible to know that the window is a Java app, but not that it matches the process "nbexec" for example. Here are some examples of well-behaved applications: Chromium: WM_CLASS(STRING) = "chromium-browser", "Chromium-browser" Firefox: WM_CLASS(STRING) = "Navigator", "Firefox" Thunderbird: WM_CLASS(STRING) = "Mail", "Thunderbird" Pidgin: WM_CLASS(STRING) = "Pidgin", "Pidgin" So, if NetBeans provided an accurate WM_CLASS xprop, it would be very helpful to many applications across Linux desktops!
One possible approach is as follows: Toolkit xToolkit = Toolkit.getDefaultToolkit(); java.lang.reflect.Field awtAppClassNameField = xToolkit.getClass().getDeclaredField("awtAppClassName"); awtAppClassNameField.setAccessible(true); awtAppClassNameField.set(xToolkit, "NetBeans"); Taken from: http://elliotth.blogspot.com/2007/02/fixing-wmclass-for-your-java.html
Still valid for 7.0RC2 and it's becoming more visible when using Netbeans under Gnome 3.0. See Gnome bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=647437 .
This is even more of a problem running multiple applications based on NetBeans platform, like NetBeans, Sql Developer, VisualVm etc at the same time, where all are presented with the same generic name.
it seems more like JDK issue to me but if you think there's a workaround (reflection), a patch is welcome
Well, I'd agree it should be fixed in the JDK (see previous link to blog post) but in the meantime it's fixable and would be much appreciated. Point me to the "startup" class or main frame or whatever in the source and I'll try to provide you with a a patch.
waiting for the patch:) (or the JDK fix...)
I think it is not unreasonable to ask for this tiny, little fix, which will improve the netbeans appearance on Gnome3-based Linux platforms. I think the code in Comment#1 should be enough, at least according to other sources on this subject. However, small as it is, the problem for me would be to dive into the netbeans sources. I really have no clue where to start. I'm assuming it would be quite simple for anyone familiar with the source to stick this in at some appropriate place. Btw, the JDK bug is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6528430, please do vote for that as well. It is from feb 2007, though, with a very low priority. And besides, it will need changes in netbeans sources anyway. I would not hold my breath for this. Thanks.
I consider this P2 since it is so obviously wrong when you run NB under GNOME 3: "java-lang-Thread" is displayed prominently at the top of the screen when NB is fronted. This bug also makes it impossible to create a proper *.desktop file, since you need to set the StartupWMClass property to something NB-specific.
Created attachment 119183 [details] Proposed patch This patch against NB dev sources works for me on JDK 7u4 in Ubuntu 12.04 in the GNOME 3 shell.
BTW http://youtrack.jetbrains.com/issue/IDEA-70806 is similar.
(In reply to comment #9) > Created attachment 119183 [details] > Proposed patch > > This patch against NB dev sources works for me on JDK 7u4 in Ubuntu 12.04 in > the GNOME 3 shell. That's good news -- does it also work with switching between multiple open Netbeans windows (dialogs, etc.) with Alt+` ?
(In reply to comment #11) > does it also work with switching between multiple open > Netbeans windows (dialogs, etc.) with Alt+` ? Yes. (Note that if you use the AlternateTab shell extension it would not matter anyway, since that operates just by title, not WM class.)
core-main 5832261b8434 Thanks for the patch, Jesse!
Is this 71patch3-candidate? Bug symptom does not seriously interfere with IDE unusability but it looks terrible in GNOME 3 - one of the first things you notice when starting the IDE.
BTW there seems to be no particularly good way in the NB Platform to get a general-purpose "application name invariant across versions". In this patch I just use CTL_MainWindow_Title_No_Project with the build number stripped off (*); org.netbeans.modules.keyring.gnome.GnomeProvider does pretty much the same for purposes of the GTK call g_set_application_name. It is not ideal since some version information remains (**) - "NetBeans IDE Dev" or "NetBeans IDE 7.2" or whatever. For Platform apps the problem may or may not exist, depending on whether the developer tries to put variable information in the "Application Title" branding field. (*) A minor I18N violation in principle but unlikely to ever matter, since the known values of this key either do not use the {0} param at all, or use it only as a suffix " {0}". (**) Which is why kde.KWalletProvider.getApplicationName hardcodes the name (bug #200657), though in that case hardcoding is actually best since we would prefer to use the same wallet across all NB-based apps.
Integrated into 'main-golden', will be available in build *201205110400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/5832261b8434 User: S. Aubrecht <saubrecht@netbeans.org> Log: #183739 - provide proper app name on Linux
in release71_fixes as 3bb933029016
Integrated into 'releases', will be available in build *201205151102* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/3bb933029016 User: S. Aubrecht <saubrecht@netbeans.org> Log: #183739 - provide proper app name on Linux
Product Version: NetBeans IDE 7.1.2 (Build 201204101705) Java: 1.6.0_32; Java HotSpot(TM) Client VM 20.7-b02 System: Linux version 3.0.0-19-generic running on i386; UTF-8; en_US (nb) For this version of NB xprop shows now: WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "NetBeans IDE 7.1.2" So, works for me and verified :) .
ttokoly - not sure what you are testing, since the fix is not in 7.1.2. It is in 7.2 dev builds, and scheduled for 7.1.3. For 7.1.2 you should still see the bug: WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "java-lang-Thread"
(In reply to comment #20) > ttokoly - not sure what you are testing, since the fix is not in 7.1.2. It is > in 7.2 dev builds, and scheduled for 7.1.3. For 7.1.2 you should still see the > bug: > > WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "java-lang-Thread" I expect Tomas tested 7.1.2 + patch3 as we were testing it today ... Tomas, please confirm.
Yes, as Marian says - 7.1.2 + patch 3!
Apparently this fix didn't make it to 7.2beta?
(In reply to comment #23) > Apparently this fix didn't make it to 7.2beta? No, I think it was made after Beta was branched. Check dev builds.
Note that the fix does not work on the splash screen - just on the IDE window after startup.
Any chance of a backport to 7.2?
nedenom: this fix is already in 7.2. If you observe a problem in 7.2 (or later), file a new bug report with details to reproduce, and link to this one as appropriate.
(In reply to comment #27) > nedenom: this fix is already in 7.2. If you observe a problem in 7.2 (or > later), file a new bug report with details to reproduce, and link to this one > as appropriate. OK, sorry, I was confused by the previous comments about it being included only in 7.1.2 + patch 3. I was looking for a fix for the double launcher icon problem, and I thought this was it, but Netbeans 7.2 still has a double icon by default. I now included the following line in my netbeans-7.2.desktop file: StartupWMClass=NetBeans IDE 7.2 That solves the double icon problem. I think the installer should have done this automatically, but I guess that is a separate issue... Anyway, thanks for fixing this property!
(In reply to comment #28) > > That solves the double icon problem. I think the installer should have done > this automatically, but I guess that is a separate issue... Please file a new issue if you want this fixed, thanks.