Skip to content

Commit

Permalink
Prefer gnome-screenshot if xdisplay is None
Browse files Browse the repository at this point in the history
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
  • Loading branch information
radarhere and nulano committed Jun 12, 2022
1 parent a48d950 commit b1ba090
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PIL/ImageGrab.py
Expand Up @@ -61,7 +61,7 @@ def grab(bbox=None, include_layered_windows=False, all_screens=False, xdisplay=N
left, top, right, bottom = bbox
im = im.crop((left - x0, top - y0, right - x0, bottom - y0))
return im
elif not Image.core.HAVE_XCB and shutil.which("gnome-screenshot"):
elif shutil.which("gnome-screenshot"):
fh, filepath = tempfile.mkstemp(".png")
os.close(fh)
subprocess.call(["gnome-screenshot", "-f", filepath])
Expand Down

0 comments on commit b1ba090

Please sign in to comment.