KeysPerSecond icon indicating copy to clipboard operation
KeysPerSecond copied to clipboard

Layout settings window is not showing up in Ubuntu 22.04 Wayland GNOME desktop

Open UlyssesZh opened this issue 2 years ago • 3 comments

Just as the title says. Other windows (configure keys, about, etc.) work just fine so far.

UlyssesZh avatar Jun 10 '22 04:06 UlyssesZh

Interesting, I assume this holds for both the button on the main screen and the button in the live configuration screen? Is there any error output present in the console? On Windows this works fine and I don't immediately see anything that would be significantly different on Ubuntu, so this might be a hard one to debug. I'll first see if I can reliably reproduce this to get more data to work with.

RoanH avatar Jun 11 '22 22:06 RoanH

I found that this bug can be reproduced in Ubuntu 20.04 X11 GNOME desktop. The main screen is fine, and the grids are shown correctly. The layout configuration screen is not showing up. There is a Java exceptions showing in the console:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "dev.roanh.kps.ui.model.SpecialNumberModel.isSpecialValueSelected()" because "this.incompatible.model" is null
	at dev.roanh.kps.layout.LayoutValidator$FieldListener.specialValid(LayoutValidator.java:127)
	at dev.roanh.kps.ui.model.SpecialNumberModel.getPreviousValue(SpecialNumberModel.java:96)
	at java.desktop/javax.swing.plaf.basic.BasicSpinnerUI.updateEnabledState(BasicSpinnerUI.java:555)
	at java.desktop/javax.swing.plaf.basic.BasicSpinnerUI.updateEnabledState(BasicSpinnerUI.java:535)
	at java.desktop/javax.swing.plaf.basic.BasicSpinnerUI.installUI(BasicSpinnerUI.java:163)
	at java.desktop/javax.swing.JComponent.setUI(JComponent.java:730)
	at java.desktop/javax.swing.JSpinner.setUI(JSpinner.java:220)
	at java.desktop/javax.swing.JSpinner.updateUI(JSpinner.java:245)
	at java.desktop/javax.swing.JSpinner.<init>(JSpinner.java:190)
	at dev.roanh.kps.ui.dialog.LayoutDialog.createListItem(LayoutDialog.java:218)
	at dev.roanh.kps.ui.dialog.LayoutDialog.configureLayout(LayoutDialog.java:79)
	at dev.roanh.kps.Menu.lambda$createMenu$32(Menu.java:427)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
	at java.desktop/java.awt.Component.processEvent(Component.java:6391)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
	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)

UlyssesZh avatar Jun 12 '22 00:06 UlyssesZh

Awesome, that's exactly what I need. I have no idea what the root cause of this issue is, since in theory this looks like it should affect Windows as well (but it doesn't). However, this should be enough information to at least mitigate the issue even if I can't find the true cause.

RoanH avatar Jun 13 '22 20:06 RoanH

This should be fixed now in v8.7, though I didn't manage to reproduce the issue on my own Ubuntu install (not running Wayland GNOME though). However, it seems like this probably had more to do with the exact version/distribution of Java being used anyway.

RoanH avatar Aug 26 '22 13:08 RoanH

Still reproducable for v8.7 on Ubuntu 20.04 X11 GNOME. Exactly the same exception. I will test this more.

UlyssesZh avatar Sep 22 '22 17:09 UlyssesZh

Confirmed also still reproducable on another Ubuntu machine (Ubuntu 22.04).

UlyssesZh avatar Sep 22 '22 17:09 UlyssesZh

Thanks for the extra information, are you sure the exception is exactly the same? Because as far as I can tell that shouldn't be possible anymore. I should have a system lying around with those specifications though, so I'll try to reproduce it.

RoanH avatar Oct 08 '22 21:10 RoanH

Alright, I've managed to reproduce it (slightly different line numbers), still not sure what the cause is, but this should help to figure that out.

RoanH avatar Oct 08 '22 21:10 RoanH

Actually, the new line numbers gave it away. I fixed the bug in the location from your original exception, but it turns out that there is another place I used the same pattern that I did not fix. So this should be fairly easy to resolve.

RoanH avatar Oct 08 '22 21:10 RoanH

Confirmed this to be really fixed now, the fix will be released with version 8.8 (already available on master).

RoanH avatar Oct 08 '22 21:10 RoanH

And thanks again for the report and extra information!

RoanH avatar Oct 08 '22 21:10 RoanH