Giter VIP home page Giter VIP logo

Comments (4)

Igetin avatar Igetin commented on May 19, 2024 1

The gnome-screenshot workaround works, thank you.

from normcap.

dynobo avatar dynobo commented on May 19, 2024

Thanks for the report, @Igetin . I can reproduce the problem on Ubuntu 20.04 with Gnome under Wayland.

This is probably an issue in the python library mss, which I'm leveraging to get the screenshot on the multiple platform.

Just to be sure, can you please also run the following snippet, e.g. by typing it in python3 console, can you confirm that you experience the same behavior as described below?

If I run only the following lines...

import mss
fn = mss.mss().shot(mon=-1, output="screenshot.png")
print(fn)

...under X it works (filename is printed, screenshot saved), while under Wayland I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/holger/.local/lib/python3.8/site-packages/mss/factory.py", line 41, in mss
    return linux.MSS(**kwargs)
  File "/home/holger/.local/lib/python3.8/site-packages/mss/linux.py", line 226, in __init__
    self.root = self.xlib.XDefaultRootWindow(MSS.display)
  File "/home/holger/.local/lib/python3.8/site-packages/mss/linux.py", line 175, in validate
    raise ScreenShotError(err, details=details)
mss.exception.ScreenShotError: XDefaultRootWindow() failed

from normcap.

dynobo avatar dynobo commented on May 19, 2024

I opened an issue for mss: BoboTiG/python-mss#155

Beside waiting to get it fixed in that dependency, I'll think about a (temporary) workaround, e.g. by falling back to pyscreenshot or an execution of gnome-screenshot. But I'll have to check, if the effort is worth the temporary benefit. Stay tuned! :-)

from normcap.

dynobo avatar dynobo commented on May 19, 2024

I added a fallback for wayland. However, that workaround uses gnome-screenshot tool, which have to be installed (it is by default on Ubuntu). Please test and report back, if it worked.

from normcap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.