dshoreman / nextshot

A simple tool for taking screenshots on Linux and sharing via Nextcloud
GNU General Public License v2.0
42 stars 3 forks source link

Area selection not working in Wayland #9

Closed dshoreman closed 5 years ago

dshoreman commented 5 years ago

While NextShot is able to copy share links via wl-copy, it is highly likely that import is either only capable of capturing XWayland windows or simply won't work at all.

We'd probably need to use a different tool depending on the WM/DE being used, because each compositor has their own way of doing things. Or so I gather...

dshoreman commented 5 years ago

After some testing in Wayland/Sway, the import command does work, but only partially.

Window Screenshots

Running import /tmp/foo.png and clicking on an XWayland window (e.g. Firefox) yields a screenshot of the window as expected.

Area Selection

Dragging fails to draw the selection box at all - even when over an X window running through XWayland. When selection ends, import fails with the following error:

import: unable to read X window image '': Resource temporarily unavailable @ error/xwindow.c/XImportImage/5044.
import: '/tmp/foo.png' @ error/import.c/ImportImageCommand/1288.
dshoreman commented 5 years ago

It's looking increasingly like Wayland will need env-specific toolsets. Regardless of whether shooting an XWayland window or a native Wayland one, maim is always producing a transparent image.

Selection Drawing

slop

slurp