picom icon indicating copy to clipboard operation
picom copied to clipboard

Add transparent-clipping-exclude config option to improve usability with screenshooting tools

Open stefanradziuk opened this issue 4 years ago • 3 comments

As described in #663, using transparent-clipping does not interact well with screenshooting tools with window selection indicators. The screenshooting tool draws a mostly transparent full-screen window to highlight the window selection, which means that with transparent-clipping enabled only the root window and the window selection indicator are visible.

This PR adds an transparent-clipping-exclude config entry, which allows the user to specify windows that should bypass the transparent-clipping = true setting. The transparent elements of such windows will show any windows below, not just the root window.

Tested with slop, xfce4-screenshooter and st (I don't see much point in using this with a terminal emulator window but it works).

stefanradziuk avatar Dec 02 '21 00:12 stefanradziuk

Codecov Report

Merging #738 (7bd63db) into next (8a373c3) will increase coverage by 0.01%. The diff coverage is 100.00%.

:exclamation: Current head 7bd63db differs from pull request most recent head 2328b97. Consider uploading reports for the commit 2328b97 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             next     #738      +/-   ##
==========================================
+ Coverage   37.97%   37.98%   +0.01%     
==========================================
  Files          48       48              
  Lines       10562    10564       +2     
==========================================
+ Hits         4011     4013       +2     
  Misses       6551     6551              
Impacted Files Coverage Δ
src/config.h 23.52% <ø> (ø)
src/picom.c 67.57% <ø> (-0.03%) :arrow_down:
src/win.h 78.12% <ø> (ø)
src/config_libconfig.c 57.09% <100.00%> (+0.14%) :arrow_up:
src/win.c 68.28% <100.00%> (+0.05%) :arrow_up:

codecov[bot] avatar Dec 02 '21 00:12 codecov[bot]

What is the plan with this?

This is exactly what I need. I have seen this "work-around" #663 . But it does not help me because i want the rounded edges of my "d-menu" to be transparent to other windows.

DavidAnderegg avatar May 01 '22 12:05 DavidAnderegg

I'm happy to help get this merged if there's interest. I've been using this branch daily for the past few months and it works well for me.

cc @yshui

stefanradziuk avatar May 01 '22 12:05 stefanradziuk

@stefanradziuk hi! sorry for neglecting this PR for so long!

so c2_match is heavy so we don't want to call it in the render code path. usually we add a variable to cache the result, and only update the cached result when necessary. you can see win_on_factor_change for some examples.

yshui avatar Oct 12 '22 09:10 yshui

No worries, thanks for the suggestion. Cached the c2_match result and updated with latest next changes -- seems to be working fine after quick testing.

stefanradziuk avatar Oct 19 '22 22:10 stefanradziuk

@stefanradziuk this looks good to me!

can you update the help messages in options.c, the man page, and the sample config? also, can you rebase your branch onto next?

thanks!

yshui avatar Oct 23 '22 21:10 yshui

can you update the help messages in options.c, the man page, and the sample config? also, can you rebase your branch onto next?

thanks!

Done, let me know if the help entry makes sense. Also, I wasn't sure about the switch case numbering in options.c -- I wanted it to be adjacent to transparent-clipping but didn't want to renumber other options. Feel free to amend as you see fit.

stefanradziuk avatar Oct 23 '22 22:10 stefanradziuk

Yep, it looks good! Thank you!

yshui avatar Oct 23 '22 23:10 yshui