-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Refactor layer surface implementations (again) #892
Conversation
d1ad77c
to
c980692
Compare
Okay, I haven't found any new issues with both implementations. Guess it's ready for review and wider testing... This PR also supersedes #545 |
Awesome stuff @alebastr! |
Previous attempts to use auto exclusive zone from gtk-layer-shell failed because gls was expecting real booleans (`TRUE`/`FALSE`) as set_anchor arguments. With that being fixed, gtk_layer_auto_exclusive_zone_enable makes gls handle everything related to the bar resizing. The only remaining purpose of onConfigureGLS is to log warnings and bar size changes; gtk-layer-shell code path no longer needs saved width_ or height_ values.
Extract two surface implementations from the bar class: GLSSurfaceImpl and RawSurfaceImpl. This change allowed to remove _all_ surface type conditionals and significantly simplify the Bar code. The change also applies PImpl pattern to the Bar, allowing to remove some headers and fields from `bar.hpp`.
Replace a couple of header includes with forward declarations.
wayland log shows that some changes were committed twice and some weren't committed until the next redraw.
Invisible bar on a `top` layer would still intercept pointer events and stop them from reaching windows below. Always changing the layer to to `bottom` along with making bar invisible would prevent that.
c980692
to
9c56656
Compare
Sorry, that wasn't conscious. Been working with different code style too much 😄 |
Tested and LGTM, thanks for this refacto so far. |
An attempt to update the bar code for #860 that went overboard. I'm pretty sure that something is broken in this branch, just haven't figured out what. I'll be keeping this as a draft until I'm convinced that the only collateral damage is logs.
GLSSurfaceImpl
works fine for me so far, which is not surprising with how small it is after lettinggtk-layer-shell
manage exclusive zone.RawSurfaceImpl
is not so extensively tested, but I'm going to switch to it for next few days and try all the configuration changes possible via IPC.The end goal is a live configuration reload and updates from sway IPC events, but the path is long (alebastr/Waybar@master...swaybar-ipc is a somewhat ugly proof of concept for the IPC part).
It might also require some feedback and breaking changes as I don't know how close we want to be to swaybar behavior and how good is the idea to apply all supported configuration from sway's
barconfig_update
event.