8

I am on Ubuntu 18.04. After I wake from hibernation, my chrome looks like this.

Even when I open new tabs. It still does not render things properly. The only thing that works is closing all open windows of chrome and reopening the tabs.

I have the same issue with Slack (I have to quit and close even the snippet in the corner of the screen and then reopen).

EDIT: This is the same question as Problems with chrome browser after suspend the computer on Ubuntu 20.04 and Chrome causing weird flickering since upgrade to 85.0.4183.83

But a solution that does not involve disabling hardware acceleration (which makes Chrome slow) is still missing. Furthermore, the issue with Slack hasn't been mentioned either.

Does any one have an idea of how to fix this? Thanks

9
  • 1
    Did you resolve this in the end? I have the same issue with Chrome on Manjaro 20.0.1.
    – user1132574
    Oct 2, 2020 at 14:04
  • Not yet. Let me know if you find a solution Oct 2, 2020 at 18:31
  • 1
    Maybe this will solve it: askubuntu.com/a/1274056/1132574 will try to enable that tonight and see if it goes away. Maybe you can try that too.
    – user1132574
    Oct 2, 2020 at 19:10
  • 1
    I can confirm that enabling vulkan in Chrome resolved the issue on my Manjaro install.
    – user1132574
    Oct 2, 2020 at 19:12
  • 3
    Does this answer your question? Problems with chrome browser after suspend the computer on Ubuntu 20.04
    – karel
    Oct 3, 2020 at 4:49

1 Answer 1

7

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).

2
  • That's a nice find. Thank you very much. I didn't find an explanation for what are the cases pre and post doing there. Neither what are the parameters $1 and $2. Do you know how this works? Nov 11, 2020 at 1:23
  • 1
    "Immediately before entering system suspend and/or hibernation (...) will run all executables in /usr/lib/systemd/system-sleep/ and pass two arguments to them. The first argument will be "pre", the second either "suspend", "hibernate", "hybrid-sleep", or "suspend-then-hibernate" depending on the chosen action. Immediately after leaving system suspend and/or hibernation the same executables are run, but the first argument is now "post"." freedesktop.org/software/systemd/man/… Nov 12, 2020 at 2:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .