-
-
Notifications
You must be signed in to change notification settings - Fork 732
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
Warbar claims buffer is opaque when it's being hidden by depressing $mod #3492
Comments
This issue appears partially fixed with #3528 . Only tested for ~5min but the usual "$mod+focus elsewhere" doesn't leave a black silhouette anymore. That is such a relief! On a side note, I have a (short) CSS animation to slowly transition the opacity of the bar when displayed. I see that it first displays a black background when the bar appears. Example when increasing the animation time + low opacity + pink background: a black background appears first. This does not happen on waybar v0.11.0 2024-09-17-235610_recording.mp4 |
In Sway, a black silhouette is still left on the wallpaper in workspaces with only floating windows. It disappears the next time the bar is displayed |
I don't believe it's possible to completely fix that one :( The root of the problem is in the If you feel like something is missing in the list - indeed, CSS The documented workaround is to use waybar::Bar::Bar(...) {
// ...
window.signal_style_updated().connect(sigc::mem_fun(*this, &Bar::onStyleUpdated));
// ...
}
void waybar::Bar::onStyleUpdated() {
if (auto gdk_window = window.get_window(); gdk_window) {
/* Always assume that the window is transparent */
static Cairo::RefPtr<Cairo::Region> region;
gdk_window->set_opaque_region(region);
}
} The problem is, GTK explicitly commits its own update, and our change gets deferred until the next frame callback. In the best case it results in flickering, and in the worst case - you'll be seeing a black rectangle until the compositor starts sending frame callbacks again. The full patch is here: alebastr@set-opaque-region. I'm fine with submitting it if it makes things better for someone, but it didn't do a lot in my testing. tl;dr: window#waybar {
background-color: alpha(pink, 0.5);
} Footnotes
|
@alebastr , thank you for the in-depth research. The |
Waybar seems to swap out the buffer when it's trying to hide/show itself when using sway IPC mode with the $mod key being depressed. When it swaps the buffer out to something that's completely transparent (functionally hiding it) it still claims the buffer being opaque and so the wayland compositor might try to do optimizations that aren't safe (like in sway master). Waybar needs to have a solid background color configured for the bug to occur.
It's strange that we are committing a new buffer instead of just mapping/unmapping the layer shell?
Ref: swaywm/sway#8075
The text was updated successfully, but these errors were encountered: