You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Patrik Karlström <pa...@trixon.se> on 2021/03/28 11:01:18 UTC

WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

I noticed that kwin did not apply my window rules any more, not for
NetBeans nor for my platform application.

pata@xps:~/tmp$ xprop WM_CLASS
WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

That was with 16.0.0.fx-zulu, switching to Java 11 works fine (so did 15):

pata@xps:~/tmp$ xprop WM_CLASS
WM_CLASS(STRING) = "Mapton", "Mapton"

Found this thread on the users list
https://mail-archives.apache.org/mod_mbox/netbeans-users/202001.mbox/browser

Back then it was stated that the nb snap worked fine, but today it is
not, wrt to WM_CLASS.

/Patrik

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Patrik Karlström <pa...@trixon.se>.
Much better thank you.
WM_CLASS(STRING) = "Mapton", "Mapton"

Den mån 29 mars 2021 kl 19:22 skrev Bläsing, Matthias
<mb...@doppel-helix.eu>:
>
> Hi Patrik,
>
> Am 29.03.2021 um 19:02 schrieb Patrik Karlström:
> > Ok, so I tested with -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED,
> > but the result is still
> > WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread".
>
> sorry, the package was wrong. Could you please retest with
>
> -J--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED
>
> The syntax is --add-opens=<module>/<package>=<targetmodule> and the
> class XToolkit is in the sun.awt.X11 package.
>
> Greetings
>
> Matthias
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Bläsing, Matthias <mb...@doppel-helix.eu>.
Hi Patrik,

Am 29.03.2021 um 19:02 schrieb Patrik Karlström:
> Ok, so I tested with -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED,
> but the result is still
> WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread".

sorry, the package was wrong. Could you please retest with

-J--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED

The syntax is --add-opens=<module>/<package>=<targetmodule> and the 
class XToolkit is in the sun.awt.X11 package.

Greetings

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Patrik Karlström <pa...@trixon.se>.
Ok, so I tested with -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED,
but the result is still
WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread".

Den sön 28 mars 2021 kl 21:13 skrev Bläsing, Matthias
<mb...@doppel-helix.eu>:
>
> [Resend to mailinglist]
>
> Hi Jan,
>
>
> Am 28.03.2021 um 19:50 schrieb Jan Lahoda:
> > If we need to get access to something like this, using something more
> > specific like "--add-opens java.desktop/sun.awt=ALL-UNNAMED" is AFAIK a
> > much better way.
>
> good idea. I don't see the swing implementation for X11 to change
> anytime soon, so this would also be a longer term solution and we
> already open half of the JDK, so would be perfectly in line with the
> codebase.
>
> @Patrik could you please also test that?
>
> In this case it was a case of "If (all) you have a hammer, everything
> looks like a nail". Thanks for reminding me, that there are more
> appropriate tools available.
>
> Greetings
>
> Matthias
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Bläsing, Matthias <mb...@doppel-helix.eu>.
[Resend to mailinglist]

Hi Jan,


Am 28.03.2021 um 19:50 schrieb Jan Lahoda:
> If we need to get access to something like this, using something more
> specific like "--add-opens java.desktop/sun.awt=ALL-UNNAMED" is AFAIK a
> much better way.

good idea. I don't see the swing implementation for X11 to change 
anytime soon, so this would also be a longer term solution and we 
already open half of the JDK, so would be perfectly in line with the 
codebase.

@Patrik could you please also test that?

In this case it was a case of "If (all) you have a hammer, everything 
looks like a nail". Thanks for reminding me, that there are more 
appropriate tools available.

Greetings

Matthias



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Jan Lahoda <la...@gmail.com>.
If we need to get access to something like this, using something more
specific like "--add-opens java.desktop/sun.awt=ALL-UNNAMED" is AFAIK a
much better way.

Jan

On Sun, Mar 28, 2021 at 5:03 PM Bläsing, Matthias <mb...@doppel-helix.eu>
wrote:

> Hi Patrik,
>
> Am 28.03.2021 um 13:01 schrieb Patrik Karlström:
> > I noticed that kwin did not apply my window rules any more, not for
> > NetBeans nor for my platform application.
> >
> > pata@xps:~/tmp$ xprop WM_CLASS
> > WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"
> >
> > That was with 16.0.0.fx-zulu, switching to Java 11 works fine (so did
> 15):
> >
> > pata@xps:~/tmp$ xprop WM_CLASS
> > WM_CLASS(STRING) = "Mapton", "Mapton"
>
> I suspect that you see:
>
> https://openjdk.java.net/jeps/396
>
> combined with:
>
> https://bugs.openjdk.java.net/browse/JDK-6528430
>
> (yes the issue was created 14! years ago!)
>
> Please test if adding "--illegal-access=permit" to the JVM launch flags
> helps. JVM flags supplied via config or CLI need to be prefixed with
> "-J", so the above becomes "-J--illegal-access=permit".
>
> I tested on windows with "--illegal-access=debug" like this:
>
> C:\LokaleProgramme\netbeans\bin\netbeans64.exe -J--illegal-access=debug
>
> And got this report:
>
> WARNING: Illegal reflective access by
> org.netbeans.core.output2.FileMapStorage
> (jar:file:/C:/LokaleProgramme/netbeans/platform/modules/org-netbeans-core-output2.jar!/)
> to method java.nio.DirectByteBuffer.cleaner()
>          at
> org.netbeans.core.output2.FileMapStorage.unmap(FileMapStorage.java:311)
>          at
> org.netbeans.core.output2.FileMapStorage.access$400(FileMapStorage.java:38)
>          at
> org.netbeans.core.output2.FileMapStorage$MappedBufferResource.decRefs(FileMapStorage.java:479)
>          at
> org.netbeans.core.output2.FileMapStorage.updateContents(FileMapStorage.java:377)
>          at
> org.netbeans.core.output2.FileMapStorage.getReadBuffer(FileMapStorage.java:341)
>
> As "--illegal-access" is deprecated for removal, we might need to turn
> to harder methods to hack into the JDK (or convince someone to fix the
> bug mentioned above). Given that we have JNA in our hands, we could try
> to go throught the JNI layer to break module encapsulation (yes it is a
> sledgehammer, but I don't see an alternative, which will then also work
> on JDK 16).
>
> It seems our friends over at JetBrains face the same problem:
>
> https://youtrack.jetbrains.com/issue/JBR-1280
>
> Before doing anything further we should see if running with
> "--illegal-access=permit" helps.
>
> Greetings
>
> Matthias
>
> |
> |
>
>

Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Patrik Karlström <pa...@trixon.se>.
I can confirm that "--illegal-access=permit" helps.

Den sön 28 mars 2021 kl 17:04 skrev Bläsing, Matthias
<mb...@doppel-helix.eu>:
>
> Hi Patrik,
>
> Am 28.03.2021 um 13:01 schrieb Patrik Karlström:
> > I noticed that kwin did not apply my window rules any more, not for
> > NetBeans nor for my platform application.
> >
> > pata@xps:~/tmp$ xprop WM_CLASS
> > WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"
> >
> > That was with 16.0.0.fx-zulu, switching to Java 11 works fine (so did 15):
> >
> > pata@xps:~/tmp$ xprop WM_CLASS
> > WM_CLASS(STRING) = "Mapton", "Mapton"
>
> I suspect that you see:
>
> https://openjdk.java.net/jeps/396
>
> combined with:
>
> https://bugs.openjdk.java.net/browse/JDK-6528430
>
> (yes the issue was created 14! years ago!)
>
> Please test if adding "--illegal-access=permit" to the JVM launch flags
> helps. JVM flags supplied via config or CLI need to be prefixed with
> "-J", so the above becomes "-J--illegal-access=permit".
>
> I tested on windows with "--illegal-access=debug" like this:
>
> C:\LokaleProgramme\netbeans\bin\netbeans64.exe -J--illegal-access=debug
>
> And got this report:
>
> WARNING: Illegal reflective access by org.netbeans.core.output2.FileMapStorage (jar:file:/C:/LokaleProgramme/netbeans/platform/modules/org-netbeans-core-output2.jar!/) to method java.nio.DirectByteBuffer.cleaner()
>          at org.netbeans.core.output2.FileMapStorage.unmap(FileMapStorage.java:311)
>          at org.netbeans.core.output2.FileMapStorage.access$400(FileMapStorage.java:38)
>          at org.netbeans.core.output2.FileMapStorage$MappedBufferResource.decRefs(FileMapStorage.java:479)
>          at org.netbeans.core.output2.FileMapStorage.updateContents(FileMapStorage.java:377)
>          at org.netbeans.core.output2.FileMapStorage.getReadBuffer(FileMapStorage.java:341)
>
> As "--illegal-access" is deprecated for removal, we might need to turn
> to harder methods to hack into the JDK (or convince someone to fix the
> bug mentioned above). Given that we have JNA in our hands, we could try
> to go throught the JNI layer to break module encapsulation (yes it is a
> sledgehammer, but I don't see an alternative, which will then also work
> on JDK 16).
>
> It seems our friends over at JetBrains face the same problem:
>
> https://youtrack.jetbrains.com/issue/JBR-1280
>
> Before doing anything further we should see if running with
> "--illegal-access=permit" helps.
>
> Greetings
>
> Matthias
>
> |
> |
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Neil C Smith <ne...@apache.org>.
On Sun, 28 Mar 2021 at 16:03, Bläsing, Matthias
<mb...@doppel-helix.eu> wrote:
> I suspect that you see:
>
> https://openjdk.java.net/jeps/396

Yes, realised almost immediately it was probably this rather than the
splash WM_CLASS issue.  (sorry for the misdirect Patrik!)

Somehow we need to update the code at
https://github.com/apache/netbeans/blob/master/platform/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java#L123

This probably needs moving elsewhere to work properly too - I had
started looking at this a while back, and forgot about it.  The
problem is that at least Ubuntu's launcher only cares about the first
WM_CLASS it reads, which is why the splash causes multiple icons in
the dock by default.

Could JNA Platform handle this for us via X11 or other APIs?

> WARNING: Illegal reflective access by org.netbeans.core.output2.FileMapStorage (jar:file:/C:/LokaleProgramme/netbeans/platform/modules/org-netbeans-core-output2.jar!/) to method java.nio.DirectByteBuffer.cleaner()

Isn't that one doable via jdk.unsupported and
sun.misc.Unsafe.invokeCleaner ?  Which was added for this purpose, and
is excluded from JEP 396 and 403 I believe?

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Bläsing, Matthias <mb...@doppel-helix.eu>.
Hi Patrik,

Am 28.03.2021 um 13:01 schrieb Patrik Karlström:
> I noticed that kwin did not apply my window rules any more, not for
> NetBeans nor for my platform application.
>
> pata@xps:~/tmp$ xprop WM_CLASS
> WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"
>
> That was with 16.0.0.fx-zulu, switching to Java 11 works fine (so did 15):
>
> pata@xps:~/tmp$ xprop WM_CLASS
> WM_CLASS(STRING) = "Mapton", "Mapton"

I suspect that you see:

https://openjdk.java.net/jeps/396

combined with:

https://bugs.openjdk.java.net/browse/JDK-6528430

(yes the issue was created 14! years ago!)

Please test if adding "--illegal-access=permit" to the JVM launch flags 
helps. JVM flags supplied via config or CLI need to be prefixed with 
"-J", so the above becomes "-J--illegal-access=permit".

I tested on windows with "--illegal-access=debug" like this:

C:\LokaleProgramme\netbeans\bin\netbeans64.exe -J--illegal-access=debug

And got this report:

WARNING: Illegal reflective access by org.netbeans.core.output2.FileMapStorage (jar:file:/C:/LokaleProgramme/netbeans/platform/modules/org-netbeans-core-output2.jar!/) to method java.nio.DirectByteBuffer.cleaner()
         at org.netbeans.core.output2.FileMapStorage.unmap(FileMapStorage.java:311)
         at org.netbeans.core.output2.FileMapStorage.access$400(FileMapStorage.java:38)
         at org.netbeans.core.output2.FileMapStorage$MappedBufferResource.decRefs(FileMapStorage.java:479)
         at org.netbeans.core.output2.FileMapStorage.updateContents(FileMapStorage.java:377)
         at org.netbeans.core.output2.FileMapStorage.getReadBuffer(FileMapStorage.java:341)

As "--illegal-access" is deprecated for removal, we might need to turn 
to harder methods to hack into the JDK (or convince someone to fix the 
bug mentioned above). Given that we have JNA in our hands, we could try 
to go throught the JNI layer to break module encapsulation (yes it is a 
sledgehammer, but I don't see an alternative, which will then also work 
on JDK 16).

It seems our friends over at JetBrains face the same problem:

https://youtrack.jetbrains.com/issue/JBR-1280

Before doing anything further we should see if running with 
"--illegal-access=permit" helps.

Greetings

Matthias

|
|


Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Patrik Karlström <pa...@trixon.se>.
Den sön 28 mars 2021 kl 13:13 skrev Neil C Smith <ne...@apache.org>:
>
> On Sun, 28 Mar 2021, 12:02 Patrik Karlström, <pa...@trixon.se> wrote:
>
> > I noticed that kwin did not apply my window rules any more, not for
> > NetBeans nor for my platform application.
> >
>
> I'm surprised JDK makes a difference. I've mentioned this before, and is
> related to the new splash implementation as far as I know. Try launching
> with --nosplash and see if it works?

Just tried, --nosplash did not do anything for WM_CLASS.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

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




Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Neil C Smith <ne...@apache.org>.
On Sun, 28 Mar 2021, 12:12 Neil C Smith, <ne...@apache.org> wrote:

>
>
> On Sun, 28 Mar 2021, 12:02 Patrik Karlström, <pa...@trixon.se> wrote:
>
>> I noticed that kwin did not apply my window rules any more, not for
>> NetBeans nor for my platform application.
>>
>
> I'm surprised JDK makes a difference.
>

Actually, scratch that. Original issue is that new splash changes WM_CLASS
of first opened window. But the main window WM_CLASS gets set by reflection
into internal classes from what I recall. So two different issues now
potentially?!

Best wishes,

Neil

>

Re: WM_CLASS(STRING) = "java-lang-Thread", "java-lang-Thread"

Posted by Neil C Smith <ne...@apache.org>.
On Sun, 28 Mar 2021, 12:02 Patrik Karlström, <pa...@trixon.se> wrote:

> I noticed that kwin did not apply my window rules any more, not for
> NetBeans nor for my platform application.
>

I'm surprised JDK makes a difference. I've mentioned this before, and is
related to the new splash implementation as far as I know. Try launching
with --nosplash and see if it works?

With the IDE on Ubuntu,  renaming the .desktop file helps in terms of rules
there - there's some fallback related to that and window title I think -
not at my machine to check right now.

Best wishes,

Neil

>