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

Homero Esmeraldo
  • 282
  • 3
  • 19
  • 1
    Did you resolve this in the end? I have the same issue with Chrome on Manjaro 20.0.1. –  Oct 02 '20 at 14:04
  • Not yet. Let me know if you find a solution – Homero Esmeraldo Oct 02 '20 at 18:31
  • It has something to do with hardware acceleration it appears. When I disable hardware acceleration the problem is gone. Not really a solution though. –  Oct 02 '20 at 19:09
  • 1
    Maybe this will solve it: https://askubuntu.com/a/1274056/1132574 will try to enable that tonight and see if it goes away. Maybe you can try that too. –  Oct 02 '20 at 19:10
  • 1
    I can confirm that enabling vulkan in Chrome resolved the issue on my Manjaro install. –  Oct 02 '20 at 19:12
  • Thanks for that link. I flagged my own question as duplicate of that one. – Homero Esmeraldo Oct 03 '20 at 00:14
  • 3
    Does this answer your question? [Problems with chrome browser after suspend the computer on Ubuntu 20.04](https://askubuntu.com/questions/1273399/problems-with-chrome-browser-after-suspend-the-computer-on-ubuntu-20-04) – karel Oct 03 '20 at 04:49
  • The question is the same, but they haven't found any answer that avoids making Chrome slower. – Homero Esmeraldo Oct 05 '20 at 18:26
  • So I guess this is a duplicate question, but I cannot say that the current available questions answer what I need here. – Homero Esmeraldo Oct 05 '20 at 19:20

1 Answers1

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

  • 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? – Homero Esmeraldo Nov 11 '20 at 01: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"." https://www.freedesktop.org/software/systemd/man/systemd-suspend.service.html – Micaela Martino Nov 12 '20 at 02:29