helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
806 stars 58 forks source link

Keyboard app not un-swapping keys #94

Closed grahamperrin closed 3 years ago

grahamperrin commented 3 years ago

Booted from hello-0.3.0_0C160-FreeBSD-12.1-amd64.iso in VirtualBox on FreeBSD-CURRENT.

After attempting to un-swap keys:

image

The next run of the Keyboard app:

image

– they're still swapped.

probonopd commented 3 years ago

Seems to be caused by Error loading new keyboard description and/or Error changing xkbmap in the first screenshot. Why the heck...

probonopd commented 3 years ago

Just for fun, can you set it to German and see if the un-swap works then?

grahamperrin commented 3 years ago

No different with German. I chose to shut down.

Side note, recalling my comments in Matrix https://matrix.to/#/!EKNFbsWSwXpDOGLRex:matrix.org/$q9bxrrmVArLfVjcJUy1dQyEDckmqfGVUuVrkrjvTShc?via=matrix.org&via=t2bot.io shortly before I realised the bug:

Ah probono did you fix Alt-F2 for me? :-)

Alt-Tab too?

– I found both shortcuts working as I expected, maybe sooner than in the past (enough for me to smile and ask), now I assume that maybe those those two worked only because the Keyboard application had failed i.e. there's underlying wrongness (swap) for those two.

probonopd commented 3 years ago

Yes, sounds like it...

grahamperrin commented 3 years ago

This issue was/is intermittent. I found it with at least two boots, but not all.

probonopd commented 3 years ago

Thanks @grahamperrin - if you see it again, please copy&paste the text output you see when running the tool on the command line. Thanks.

grahamperrin commented 3 years ago

hello-0.3.0_0C163-FreeBSD-12.1-amd64.iso

First attempt to make the change, immediately after ending the welcome routine: the change was not effective. Specifically:

  1. double click the Keyboard icon
  2. click to enable Caps Lock
  3. click to not have keys swapped
  4. click English (United Kingdom)

– then I probably closed the app, but I can't recall how.

After finding step 3 not effective – Control-W misinterpreted as W in the address bar of Falkon – I (checked that Keyboard app was not already running and) used the terminal.

FreeBSD% pwd
/Applications/Preferences/Keyboard.app
FreeBSD% ls -hl
total 12
-rwxr-xr-x  1 root  wheel    14K Jan 10 18:29 Keyboard
lrwxrwxrwx  1 root  wheel    47B Jan 10 18:29 Keyboard.py -> /Applications/Preferences/Keyboard.app/Keyboard
drwxr-xr-x  2 root  wheel     3B Jan 11 13:17 Resources
FreeBSD% ./Keyboard
self.has_apple_keyboard: False
xkbmap rules: evdev
xkbmap model: pc105
xkbmap layout: gb
xkbmap options: ['ctrl:swap_lalt_lctl']
['us', 'gb', 'fr', 'es', 'de', 'it', 'jp', 'pt', 'no', 'se', 'fi', 'ru', 'tr', 'il']
us = English (United States)
gb = English (United Kingdom)
Layout in xkbmap matches this layout
fr = Français
es = Español
de = Deutsch
it = Italiano
jp = 日本人
pt = Português
no = Norsk
se = Svenska
fi = Suomalainen
ru = Pусский
tr = Türk
il = עברית
selected_index, 2
QKqueueFileSystemWatcherEngine::addPaths: open: No such file or directory
Selected layout changed
English (United Kingdom)
selected_layout gb
Changed xkbmap successfully
xkbmap rules: evdev
xkbmap model: pc105
xkbmap layout: gb
xkbmap options: ['ctrl:swap_lalt_lctl']
Error loading new keyboard description
Error changing xkbmap
xkbmap rules: evdev
xkbmap model: pc105
xkbmap layout: gb
xkbmap options: ['ctrl:swap_lalt_lctl']
option_to_be_removed: ctrl:swap_lwin_lctl,ctrl:swap_rwin_rctl,ctrl:swap_lalt_lctl
Clearing xkbmap options
Cleared xkbmap options successfully
xkbmap rules: evdev
xkbmap model: pc105
xkbmap layout: gb
Changed xkbmap successfully
xkbmap rules: evdev
xkbmap model: pc105
xkbmap layout: gb
option_to_be_removed: caps:none
Clearing xkbmap options
Cleared xkbmap options successfully
xkbmap rules: evdev
xkbmap model: pc105
xkbmap layout: gb
Changed xkbmap successfully
xkbmap rules: evdev
xkbmap model: pc105
xkbmap layout: gb
xkbmap options: ['ctrl:swap_lalt_lctl']
/home/liveuser/.config/hello
FreeBSD% 
grahamperrin commented 3 years ago

The same problem with a first run of an installation of 0.3.0_0C164.

I wonder, is it triggered by performing steps 2, 3 and 4 in rapid succession? I don't wait for the asynchronous progress indicator to stop spinning, at step 2, before proceeding with step 3.

After a restart: I found both checkboxes clear (correct) but my previously set preference for English (United Kingdom) had been lost. Now re-set.

probonopd commented 3 years ago

I don't wait for the asynchronous progress indicator to stop spinning, at step 2, before proceeding with step 3.

Yes. That is it. I was assuming that by setting the cursor to spinning it would prevent one from clicking anything in the meantime, but possibly this assumption was wrong.

Please repeat everything you are doing but do not click anything while you see the spinning cursor. If that fixes it, I know what to do. Thanks!

probonopd commented 3 years ago

Please retest in the next build.

grahamperrin commented 3 years ago

0.4.0 (0D8) in a virtual machine limited to a single processor.

Re: https://github.com/helloSystem/ISO/issues/94#issuecomment-758230425 I take the four steps slowly, waiting for disappearance of the asynchronous progress indicator. Then close and reopen the Keyboard app. Result:

image

probonopd commented 3 years ago

Now I am really puzzled because I can't seem to be able to reproduce this. Can you please tell me what you are clicking on in which order?

grahamperrin commented 3 years ago
  1. 0.4.0 (0D8) (hello-0.4.0_0D8-FreeBSD-12.1-amd64.iso, md5 verified) in a VirtualBox guest limited to a single processor, VirtualBox host on FreeBSD-CURRENT
  2. Escape
  3. unset boot_mute
  4. boot -v
  5. await appearance of the Welcome app
  6. click the close box
  7. click Preferences
  8. double click to open the Keyboard application
  9. click to enable Caps Lock
  10. await disappearance of the asynchronous progress indicator
  11. move the pointer up a few pixels
  12. click to not have keys swapped
  13. await disappearance of the asynchronous progress indicator
  14. move the pointer up
  15. click English (United Kingdom)
  16. await disappearance of the asynchronous progress indicator
  17. Control-W no effect
  18. Alt-W no effect
  19. Control-Q no effect
  20. Alt-Q quits, in other words step 12 was not effective.
probonopd commented 3 years ago

Thanks @grahamperrin with these exact steps I can reproduce it... :+1:

grahamperrin commented 3 years ago

Thanks. I can't retest at the moment but if I recall correctly, the bug might be avoidable if step 9 is skipped.

probonopd commented 3 years ago

I hope to have fixed this in https://github.com/helloSystem/Utilities/commit/757aa02bbdf7fb649432b08d5db9c033bd502589, at least I could no longer reproduce it.

grahamperrin commented 3 years ago

0.4.0 (0D13)

No longer reproducible. Thanks!

probonopd commented 3 years ago

Wow, I am really happy that finally this is solved. Thanks for retesting! :100: