By default, you can scroll inactive windows by hovering over them.
If you don’t want this feature, then you can turn it off. Here’s how:
Press the Windows and I keys simultaneously to open the Settings app.
On the left sidebar, click Mouse.
Disable the switch under “Scroll inactive windows when I hover over them.”
Note: If you want to enable this feature, follow the steps above, but enable it instead of disabling it.
Go to HKEY_CURRENT_USER > Control Panel > Desktop.
Double-click the MouseWheelRouting in the right pane.
Enter 2 (to enable) or 0 (to disable) in the Value data field.
Click the OK button.
Sign out and then sign back in.