Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Cursor is captured without -c when $WLR_NO_HARDWARE_CURSORS is set to 1 in sway #112

Closed
blurgyy opened this issue Dec 21, 2021 · 1 comment

Comments

@blurgyy
Copy link

blurgyy commented Dec 21, 2021

Hi, thank you for the great tool!

When I start sway with environment varialbe $WLR_NO_HARDWARE_CURSORS=1 to use software cursors, grim will capture my cursor even if I did not pass it with -c flag. This results in all my captured screenshots to contain a portion of my cursor, depending on the last position of my cursor:
Top-left: image
Top-right: image
Bottom-left: image
Bottom-right: image

I also fail to grab pixel color with the method documented in README:

grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:-

Since my cursor is always captured by grim, the captured color is always the color of my cursor's tip, which is #7C7C7C in my case. I believe the issue mentioned in #96 is somewhat similar and might be related.

If I remove the export WLR_NO_HARDWARE_CURSORS=1 befor starting sway, the problem goes away, cursor will then only be captured when I explicitly pass -c to grim, and pixel color grabbing also works properly. If I keep using software cursors (i.e. setting $WLR_NO_HARDWARE_CURSORS to 1), an undesireable workaround is to quickly move my cursor out of my selection region after selection with slurp, so that the cursor will not be captured by grim.

@emersion
Copy link
Owner

grim just passes the cursor flag to wlroots, this is a wlroots bug. IIRC we already have an opened issue for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants