Chrome and Slack do not render properly after wake from hibernation in Ubuntu 18.04
I just encounter the same problem after installing Xubuntu 20.10 in an Nvidia Optimus laptop.
As you mentioned, the issue with chrome is already addressed in other posts, but no mention on Slack.
For me the solution of Andrew Bruce (based on tiangolo's answer) fixed the issue with Chrome, so I tried the same for Slack and it worked!
Basically, you have to kill the graphic process of each glitched program (I think it applies to all chromium based apps).
The relevant part is pkill -f 'the_process_name \-\-type=gpu-process'
.
So for Chrome and Slack the complete script is:
#!/bin/sh
set -e
if [ "$2" = "suspend" ] || [ "$2" = "hybrid-sleep" ]
then
case "$1" in
pre)
true
;;
post)
sleep 1
pkill -f 'chrome \-\-type=gpu-process'
pkill -f 'slack \-\-type=gpu-process'
;;
esac
fi
Which goes in /lib/systemd/system-sleep/fix-glitched-apps
and must be executable (chmod +x /lib/systemd/system-sleep/fix-glitched-apps
).