Keyboard input occasionally goes unresponsive

More
2 years 10 months ago #287365 by dberndt
I've had some time to do more digging on this.


There is a call for root_window.update() in open_file_guts that is the source of my problem.

github.com/LinuxCNC/linuxcnc/blob/221758...cripts/axis.py#L1319
Code:
    finally:         # Before unbusying, I update again, so that any keystroke events         # that reached the program while it was busy are sent to the         # label, not to another window in the application.  If this         # update call is removed, the events are only handled after that         # widget is destroyed and focus has passed to some other widget,         # which will handle the keystrokes instead, leading to the         # R-while-loading bug.         #print "load_time", time.time() - t0         root_window.update()         root_window.tk.call("destroy", ".info.progress")         root_window.tk.call("grab", "release", ".info.progress") ....

It's probably related to the fact that right after it's called the info.progress widget gets destroyed, some sort of timing bug, race condition, unclear. It could also just be the update() function as axis doesn't call it explicitly anywhere else that s frequently used. Padding these lines with some extra time.sleeps around them in various combinations to try to make space the update out from the removal of info.progress widget did not provide any meaningful fix, and introduces the event caching issue that the code is trying to prevent in the first place.

So in short, probably a problem with my OS/WM/Whatever. I've tried all the reasonable WM options available stock in linux mint 21 but all except for wayland+(some wm I've forgotten the name of) seem to have the problem. But the wayland debug output still didn't seem right, it will need more than the 5 minutes testing I gave it.

I've replaced the root_window.update() with a .update_idletasks() which I realize isn't nearly the same thing and opens up a event caching issue during file loading. I don't recommend it for anyone else, but until I update my OS again or a version of TK beyond 8.6.12 rolls into linux mint I don't plan to play with this again unless I find myself losing keyboard functionality again.

I saw in the TCL/TK 8.6.7 release notes there is a bug fixed " * Avoid unreleasable global grab due to menu keyboard traversal". Which sounds kind of like my issue, but I haven't investigated further, and I'm on a latter version.

Please Log in or Create an account to join the conversation.

Time to create page: 0.240 seconds
Powered by Kunena Forum