Delayed response to mouse clicks: pointer movement unaffected

I would be grateful for help resolving a recurring problem I have with mice clicks. Roughly every couple of days my computer stops registering mouse clicks properly. There is a delay of several seconds before a click is registered. It does not affect the movement of the pointer, which is perfectly responsive. With right clicks, the space for the menu appears, but is not populated until after a considerable delay.

I am not able to reproduce the problem at will: it happens when it happens. But when it does occur, I often have to restart the computer.

I have a Logitech mouse and a Kensington trackball. Both are affected in the same way. Both can be connected via Bluetooth or by their own 2.4GHz dongle: the type of connection makes no difference to the behaviour.

I am running Fedora 36. Thanks in advance for your suggestions!