-
-
Notifications
You must be signed in to change notification settings - Fork 692
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
[x11] Add pseudo-transparency #4496
base: master
Are you sure you want to change the base?
Conversation
Adds a new config option, `x11_fake_transparency`, to emulate transparency in bars/widgets by copying the root window contents to the background of the bar/widget before rendering the contents on top. Primary benefit of this is to prevent issues with the `Systray` widget which cannot currently be displayed with semi-transparent backgrounds.
61a3199
to
be8d34e
Compare
Getting some weird behaviour with a second screen:
EDIT: Fixed these! |
eadfe12
to
8ce3667
Compare
So far, this does not fix #2935, as can be seen in the screenshot below: |
I'll need to fix qtile-extras separately. Is that just the systray in a rectdecoration? Can you share the config for that decoration? EDIT: try with the |
Are you talking about the overlapping icon issue or an issue with rendering the decoration? I can't recreate this. Can you try disabling your compositor? As for the bar not updating, have you pulled the latest update to this PR? I think that issue should be fixed now. |
qtile-extras on latest version (built using $ yay -Qi qtile-extras-git | grep Version
Version : r291.3c00b08-1 $ qtile --version
0.23.0b3.dev64+g8ce36674 The decoration renders fine, however the icons are still overlapping and I can't figure out ATM what to change for this to work. My compositor is turned off, the bar transparency is working and the bar seems to be correctly drawn (no more weird artifacts), but I would prefer using the compositor. The bar not updating was with the latest commit. |
I assume you have Which apps are giving the overlapping widgets? Are you able to post a link to your config so I can try the whole thing? |
Yes, I do.
All which are updating:
https://github.com/ervinpopescu/dots/tree/qtile-pseudotransparency/configs/.config/qtile I need to add something about the bar not being redrawn, I was changing the wallpapers when I noticed that, so I suppose the "fake/pseudo" stands for the bar copying the part of the wallpaper which is under it to its background, correct? |
Thanks for the info. You're correct about how pseudotransparency works. We copy the wallpaper to the background of the widget. Re changing wallpaper. That would make sense as I haven't added any code to redraw the bar in that scenario yet. Are you using the built-in I'll take a look again and see if I can recreate the overlapping icons. |
I'm running the wallpaper update externally. Is there too much overhead if the bar diffs the current root background every I suppose I should migrate to using
Thanks! Can't figure out how to check if the imports can fail for you, so here is a trusty command for you to check them yourself (run in the qtile config root): grep --binary-files=without-match --color=always -r --no-filename -w import | sort -h | uniq |
You're right that the wallpaper change needs to be handled. It's trivial if using the EDIT: Yes - there is an event we can use for this. |
OK - the wallpaper change issue should be fixed (the code needs some tidying but it should work). |
# Remove PropertyChange from root window's event mask if it's there | ||
if self.eventmask & xcffib.xproto.EventMask.PropertyChange: | ||
self.eventmask &= ~xcffib.xproto.EventMask.PropertyChange | ||
self._root.set_attribute(eventmask=self.eventmask) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what other projects use when they use pseudo transparency? Polybar perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - they listen for the same event. I didn't know that before I wrote the code but just checked!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interestingly, polybar suggests that systray always uses pseudotransparency, even if the bar doesn't. I didn't think that was possible as you couldn't reparent a window with 24-bit depth into one with a 32-bit depth. I should look into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice :) happy to have that in this PR or a follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have a play around and see if I can add it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a play. Will leave this for a follow-up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work :) couple comments
The wallpaper change issue is fixed, with some expected artifacts while the bar updates its background. Any progress on the overlapping icons? |
No. Because I can't recreate it! |
@ervinpopescu Can you confirm that you get the same overlapping issue without using widget decorations? That should be the case but wanted to check. |
Yes, running e2fc6df without using decorations gives the same result. |
This minimal config (no decorations) still gives the same overlapping icons. What should I do to troubleshoot this, given that you are unable to reproduce? |
Let me try that config. Does the issue arise when you just have a single icon in the tray or does it only happen with multiple icons? Can you also explain what you do to trigger the issue i.e. how are you making the tray icon change? |
One icon triggers it and I am changing the icon based on the state of the application I guess. For example, pressing on the |
Interesting. I get that behaviour with your config but not mine. Needs further investigating. EDIT: I only get the behaviour when picom is running. NB I'm also running this within xephyr. |
OK - so the first issue with that config is that it has no wallpaper and so it disables pseudotransparency as it can't find a pixmap for the root window (lots of lines in the log). If you add a wallpaper and run your config, the icons behave correctly. However, the issue returns if you run picom... EDIT: ah, and I can now recreate with my own config. That's useful. EDIT 2: I know what the issue is. Now I just need to work out how to fix it! |
So, the issue is that |
I assume I need to wait for you to push the changes, right? For me, with |
That's odd. I can reliably trigger this when running picom but it works fine without it for me but maybe that's a xephyr thing. EDIT: And there are no changes yet as I have no idea how to fix it (or if I even can fix it). |
Oh, okay, I misunderstood, my bad. What other application can be swallowing events? And how did you figure out that is what's happening? |
I put some print statements in the parts of the widget code that trigger the bar to be redrawn. This happens when certain events are handled by the icon. Those print statements were not called once picom was running. However, I think there may be more to this than just that. Those print statements happened when I interacted directly with the icon but I'm not sure the same applies when the icons update themselves without interaction. |
Can you try with the
Do you get any different behaviours? |
Unfortunately, with or without |
Then there's still something I'm missing... Does |
Nope, nothing is changed. |
Really?! Then I've really got no idea what's causing this. |
Glad we're on the same page! 😄 |
This PR is stale because it has been open 90 days with no activity. Remove the |
This PR is stale because it has been open 90 days with no activity. Remove the |
I am still experiencing this issue. Is there any new progress? I would be willing to work on this, if anyone could summarize the current status. |
I'm not actively working on this at the moment. |
Adds a new config option,
x11_fake_transparency
, to emulate transparency in bars/widgets by copying the root window contents to the background of the bar/widget before rendering the contents on top.Primary benefit of this is to prevent issues with the
Systray
widget which cannot currently be displayed with semi-transparent backgrounds.Unlike the previous version, I've (largely) managed to contain the logic to the x11 backend.
Draft for now as some things to check:
Systray
behaviourset_wallpaper
and by external commands)