Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer screenshots using XCB over gnome-screenshot #7143

Merged
merged 3 commits into from
May 14, 2023

Conversation

nulano
Copy link
Contributor

@nulano nulano commented May 8, 2023

Alternative to #7139

From #7100 (comment)

Is the problem just a user trying to ignore gnome-screenshot when it is installed in favour of Image.core.grabscreen_x11? If so, then ImageGrab.grab(xdisplay=":0") should be sufficient with the current version of Pillow.

[...] I have just tested setting xdisplay=':0', and it ran on my end without any white flash. I believe this usage needs to be tested across different platforms. If the test is successful, it should be set as the default option. [...]

if bbox:
im = im.crop(bbox)
return im
except OSError:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original error in #6312 was:

builtins.OSError: X get_image failed: error 8 (73, 0, 1315)

src/PIL/ImageGrab.py Outdated Show resolved Hide resolved
Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
@hugovk hugovk merged commit 34ff170 into python-pillow:main May 14, 2023
@nulano nulano deleted the imagegrab-prefer-xcb branch May 14, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants