Have you considered turning off the overlay? This would resolve the issue of it giving you problems with different apps. Sadly some apps are not set correctly for use with that setting, leading to problems. If it is happening with specific apps, I would contact the app creators.
How to Disable Screen Overlay
Here are a few things you can try to turn it off.
Option 1
1. Go to "Setting", then "Developer Option"
2. Now go to "Simulate Secondory Display" and tap "off" or "None".
Option 2
1. Go to "Setting", then "More".
2. Tap "About Device".
3. Go to "Build Number" and tap it "7 times".
4. This should turn off "developer options".
5. The overlays should disappear.
Option 3
If you have the app "Clean Master" on your phone.
1. Open...