22.04 lost mouse/touchpad control

Hi folks...
I've recently upgraded to 22.04 and I have an immediate issue. Well two actually.
The first is something I saw first with 20.04 and that was that I'd lose mouse and touchpad control if I left my machine to work with a program which would finish what it was doing and then idle till I came back to it. It would then lose control of functions of the touchpad and mouse to allow control of any window functions. I would have to manually invoke Shutdown and Restart. Everything would come back to normal. I never go word of a resolution when I reported this bug but after some updates along the way things sorted itself out. Well with 22.04 that problem is back.
I also use Compiz Window Manager along with Emerald Decorator and I've had little issue for years. I know it is no longer supported but, if I now use it I lose the ability to move windows with my mouse or touchpad. Any ideas are welcome.

Hi Deke,

I suspect your USB ports are powered down after a while by the energysaving features of the kernel, all for the good of energysaving and the longevity of your laptop battery.

so, yeah, well...a non working mouse or touchpad can be the side effect of it.

You could install 'powertop' to check this:
sudo apt install powertop

Start powertop in a terminal with: sudo powertop
On the tab-page 'tunables' you will see things like:

Good        Enable SATA link power management for host2
Good        Autosuspend for USB device MYSTIC LIGHT  [MSI]
Good        Autosuspend for USB device USB Receiver [Logitech]                                                     
Good        Runtime PM for I2C Adapter i2c-6 (AMDGPU DM i2c hw bus 3)
Good        Autosuspend for USB device Corsair Gaming K55 RGB Keyboard [Corsair]

look for your touchpad and mouse here.
You can toggle the powersaves on and off
This settings will have immediate effect but won't survive a reboot
But that is easy to solve, read on:

The moment that you toggle a setting, preferably the setting of your mouse,
powertop displays a command in the upper left corner more or less like this:
echo 'on' > '/sys/bus/usb/devices/1-5/power/control';

copy that command and paste it in /etc/rc.local, just above exit 0
repeat this for the setting of your touchpad

If you don't have /etc/rc.local, create it like this:

cat<<EOF | sudo tee /etc/rc.local
#!/bin/sh -e
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

exit 0

Make it executable:

sudo chmod +x /etc/rc.local

And insert the forementioned lines
Now your mouse and touchpad should keep on working

There are more ways to get around this, see power management - How can I disable USB autosuspend for a specific device? - Ask Ubuntu