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

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

Merged
merged 1 commit into from
Oct 23, 2022

Conversation

stefanradziuk
Copy link
Contributor

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).

@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

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

❗ 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%) ⬇️
src/win.h 78.12% <ø> (ø)
src/config_libconfig.c 57.09% <100.00%> (+0.14%) ⬆️
src/win.c 68.28% <100.00%> (+0.05%) ⬆️

@DavidAnderegg
Copy link

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.

@stefanradziuk
Copy link
Contributor Author

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

@yshui
Copy link
Owner

yshui commented Oct 12, 2022

@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.

@stefanradziuk
Copy link
Contributor Author

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.

@yshui
Copy link
Owner

yshui commented Oct 23, 2022

@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!

…ed region

Transparent clipping interacts poorly with programs whose transparent
interface elements must show windows below them for functionality,
for example screenshot utilities.
@stefanradziuk
Copy link
Contributor Author

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.

@yshui
Copy link
Owner

yshui commented Oct 23, 2022

Yep, it looks good! Thank you!

@yshui yshui merged commit 2dae094 into yshui:next Oct 23, 2022
@stefanradziuk stefanradziuk deleted the transparent-clipping-ignore branch October 24, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants