Ubuntu – GNOME Screenshot area selection causing freezes

19.1020.04gnome-flashbackgnome-screenshot

Issue (Brief)

GNOME Screenshot often freezes or otherwise breaks GNOME when using the area select feature, requiring the gnome-session-b process be killed manually.

Issue (Detailed)

I have three devices running recently-installed copies of Ubuntu—two on 19.10 and one on 20.04. I am having consistent issues with GNOME Screenshot on the 20.04, although I'm reasonably certain I have experienced the same issues with the other two devices too.

When using GNOME Screenshot's area select feature (Shift+Prt Scrn), there is a good chance that the program will freeze after the area is selected (i.e., I press the hotkeys, the mouse cursor changes to a cross, I click and drag to stretch out an area selection box and then I release the click). The mouse still moves and any background audio still plays (though the usual shutter click sound does not play), but the selection box remains on screen, the cross-shaped mouse cursor remains and nothing can be interacted with. Pressing Esc does not cancel the program. So far the only way of fixing this I have found is to Ctrl+Alt+F3 into a Terminal window and run the command killall -3 gnome-session-b. No new image file is created.

There does not seem to be a repeatable pattern to cause this; sometimes it happens on the first use after boot, other times it will happily go through many screenshots before one fails. The size of the selection box doesn't seem to matter, so I don't think it's a memory thing. Whether the box crosses multiple displays or not does not seem to be a factor.

In rarer cases, the area selection box will disappear and the cursor will revert to normal but GNOME features will no longer work—the start menu and panel indicator applet icons will highlight on mouseover, but do not respond to clicking, whilst the desktop icons do neither. Panel icon shortcuts work, including file explorer which functions as normal. Again, gnome-session-b must be killed.

GNOME Screenshot is an incredibly useful tool that I use multiple times daily, and this issue is happening often enough to cause considerable inconvenience.

System Information

One desktop PC running Ubuntu 20.04, two laptops running Ubuntu 19.10. All three devices using the GNOME Flashback session. Using non-proprietary GPU drivers.

Best Answer

  • As a workaround, I've added a keyboard shortcut for xclip -selection clipboard /dev/null using commands from CompizConfig Settings Manager.

    To avoid a gnome freeze, you must always clean the clipboard before take a new screenshot:

    1. Take your area screenshot.
    2. Clean the clipboard with the new Keyboard Shortcut you've selected to call xclip -selection clipboard /dev/null.
    3. Repeat 1 & 2 as many times you want.
  • Related Question