RoanH / KeysPerSecond

A keys-per-second meter & counter. Written for osu! but should work for other rhythm games too.
https://osu.ppy.sh/forum/t/552405/
GNU General Public License v3.0
346 stars 28 forks source link

Right-Click Menu not working on overlay (Java 16 Compatibility Issue) #30

Closed IAreKyleW00t closed 3 years ago

IAreKyleW00t commented 3 years ago

I recently updated to Java 16 and noticed that there appears to be some breaking changes that prevent the right-click menu on the overlay from appearing. Full error logs are attached, but I think it's just some packages moved around.

kps.log

Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: class me.roan.kps.Menu$MenuUI (in unnamed module @0x74df377c) cannot access class sun.swing.SwingUtilities2 (in module java.desktop) because module java.desktop does not export sun.swing to unnamed module @0x74df377c
    at me.roan.kps.Menu$MenuUI.paintMenuItem(Menu.java:652)
    at me.roan.kps.Menu$MenuUI.access$300(Menu.java:604)
    at me.roan.kps.Menu$MenuItemUI.paintMenuItem(Menu.java:724)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.paint(BasicMenuItemUI.java:621)
    at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.update(BasicMenuItemUI.java:617)
    at java.desktop/javax.swing.JComponent.paintComponent(JComponent.java:797)
    at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074)
    at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
    at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
    at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
    at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
    at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
    at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
    at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
    at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
    at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5271)
    at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1643)
    at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1618)
    at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556)
    at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
    at java.desktop/javax.swing.JComponent.paint(JComponent.java:1060)
    at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
    at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:75)
    at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:112)
    at java.desktop/java.awt.Container.paint(Container.java:2003)
    at java.desktop/java.awt.Window.paint(Window.java:3949)
    at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:876)
    at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
    at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
    at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
    at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1884)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
RoanH commented 3 years ago

Thank you for the bug report, if I am not mistaken I already fixed this issue in ee6e962d310e0932e3b33374e0ee0e66ee363d49. Though I still need to publish a release that actually includes this fix. I saw that you forked the repository, could you maybe verify if this still happens/is fixed on the current master branch?

IAreKyleW00t commented 3 years ago

Yeah, I figured I would poke around and see if I could fix this for you but it looks like you already did! Yes, if I do gradlew createExe on the current master branch, the output EXE works just fine for me using Java 16. :)

RoanH commented 3 years ago

Nice, I'll attempt to get the next release published soon then. It's long overdue anyway 😅

IAreKyleW00t commented 3 years ago

Awesome, thanks so much. For now I'll just use the version I built locally

RoanH commented 3 years ago

Yeah that should be fine, feature wise everything on master should be fully stable.

RoanH commented 3 years ago

Version 8.4 will be released in a bit.