-
Notifications
You must be signed in to change notification settings - Fork 501
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
Maintaining 100% Opacity of the Content in a Transparent Menu (w/ example) #286
Comments
how it will work with a gradiented background? |
If you ask "how to make it work with gradiented background", the conditions in the shader need to be made to match all the colors in the gradient. It's like determining whether a point is on a line segment... |
@quadpixels Could you create a pull request (from a separate branch in your fork) for this? |
@blueyed |
Parse `--blur-*` options as documented in manpage
Hello Compton,
I love Compton so much, especially the gorgeous blur effects acted upon transparent menus/windows!
I think there is a little improvement that can be made to the Transparent Menus. (I don't know if this already exists in a fork or not, so if there is one please delete this issue)
When a menu is made transparent, all of its pixels are made transparent, regardless of whether a pixel is content or background. This means when you set the menu opacity to a very low value, you may not be able to easily see the text and icons on the menu. (See the picture)
I think a simple way to make the contents opaque is through the usage of the custom shader (The one used in the
--glx-fshader-win
flag.) If we only make the background menu colors transparent, we can obtain the effects in the second picture.The custom shader looks like the following:
The color values
(0.953255, 0.953255, 0.953255) (0xFCFCFC)
and(0.807843, 0.807843, 0.807843) (0xCECECE)
are the "menu background color" and "normal background color" (used in Whisker Menu) of the XFCE GreyBird GTK3 theme. Theeps
value is determined using personal experience and may need more reasoning.However, there is a catch in using colors: it stops working when the background of menu is not a solid color. I could be wrong, but I assume there is not an easy way to differentiate the background and the foreground as the information is lost when the content of the menu is handed to Compton in the form of a bitmap? Anyway the "color hack" seems to work well for me as of now.
This involved changing 3 files; the following is not elegant and it adds a dependency (GTK3) , but it demonstrates the idea.
I added a flag called
--tommy-flag
, and you can run compton with this new flag to see the results.Hope this may be useful and thanks so much!
quadpixels
(p.s. I'm not sure if this is the correct place to post this, so you may remove this issue if I'm wrong)
-----------------------Appendix--------------------------
The text was updated successfully, but these errors were encountered: