-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
Use gtk-layer-shell library for correct positioning of popups #441
Conversation
61f6002
to
0620ca3
Compare
How are the outputs destroyed now? |
std::remove_if in the end of Client::handleMonitorRemoved erases struct waybar_output from outputs_. |
0620ca3
to
c42a238
Compare
What would be the requirements for this to get merged? Is there any way to help? Only one thing that did bother me, although I'm not quite sure what the "right" behavior is: The popups use the same layer is the bar. Therefore having the bar layer set to bottom will have the popups show underneath the windows. Setting the layer to top, makes bemenu, a wayland dmenu alternative, (its layer is set to top, too) show underneath waybar. Not sure, whether bemenu should use overlay as layer. https://drewdevault.com/2018/07/29/Wayland-shells.html says that panels should use bottom as a layer though so it might be desireable to use overlay as the popup layer independent of what layer waybar is rendered at? Not sure whether this is possible. |
On hold due to me being busy with work and other things. Also because I'm not happy with layer-shell limitations and GTK integration issues. Regarding the popup layer: I was confused by this behavior as well. You may want to repost the question to swaywm/wlr-protocols, a proper place for discussions about layer-shell protocol. |
Alright, thanks for your response :) |
I am using gtk-layer-shell to test if it fixed #487. Unfortunately, I still get crashes when I disable outputs. Here it is the backtrace:
It might not be related to Waybar though, I'll try to find the issue in the next days. |
So, are you still busy? Maybe someone else could continue the work on this? It's the most important improvement for waybar right now in my opinion. It also would fix a lot of bugs that are already known. |
gtk-layer-shell wants Gdk::Monitor instead of wl_output; change code to deal with Gdk objects and slightly simplify it. Requires gtkmm 3.22.0+ (first release with Gdk::Monitor support).
To enable: use sway >= 1.2, compile waybar with `-Dgtk-layer-shell=enabled` meson option. Original behavior could be restored at runtime by setting `"gtk-layer-shell": false` in waybar config.
c42a238
to
dde700f
Compare
I apologize for the delays. This PR is seriously cursed and various things kept happening whenever I wanted to get back to the code and finish it. Changed in last revision:
|
Thanks a lot @alebastr and yeah we need to replace sigc++ that is garbage with threads... |
Initial attempt to address #63 - positioning of menus and tooltips with wmww/gtk-layer-shell library.
While the approach of the library is simple — subscribe to 'realize' for all windows and patch surfaces for anything that looks like popup, there's too much magic happening inside so I'm not even going to try adapting the code directly to waybar.
How to test:
-Dgtk-layer-shell=enabled
(disabled by default)What works:
What does not:
Limitation of wlr-layer-shell protocol: if the compositor has no support for layer-shell popups, wlr-layer-shell.get_popup will make xdg_popup silently disappear, as it does not provide any results or errors.
xdg_popup_grab
call and should be fixed elsewhere.