pop-os / cosmic-protocols

Addtional wayland-protocols used by the COSMIC desktop environment
30 stars 7 forks source link

overlap-notify: New protocol #30

Closed Drakulix closed 2 months ago

Drakulix commented 2 months ago

This protocol is intended to give layer-surfaces some information about overlapping elements.

Use cases are:

  1. Proper auto-hide functionality for cosmic-panel. Ping @wash2
  2. Desktop icons for cosmic-files. Ping @jackpot51

Please confirm if this looks usable. The intention is for cosmic-panel to watch for toplevel_enter/leave events, while the cosmic-files would probably only track exclusive layer-shell surfaces on it's layer and higher up for it's grid.

Drakulix commented 2 months ago

The toplevel_enter event includes the rectangle when we get the event though, so I guess the panel can just do that calculation.

Yeah, that is what I thought about when adding that parameter. We could obviously also do a set_overlap_region, but that feels weird and none of the already available regions fit this.

What we truly need would be something like set_window_geometry for layer-shell, but I don't wanted to dive into that rabbit hole with a small extension protocol, since that probably would have implications for layout as well.

So if there is nothing wrong in your opinion with having the panel do the necessary calculations, I would just go on with this approach.

wash2 commented 2 months ago

Yup, I don't have any problem with the panel doing the calculations.

ids1024 commented 2 months ago

Are there any cases where we anticipate two potentially-overlapping layer surfaces that both react to layer_enter events? I can imagine that causing weird feedback loops.

Probably not an argument against this protocol (if there's no obvious design that prevents that) but it's something we should be aware of when using it.

Drakulix commented 2 months ago

Are there any cases where we anticipate two potentially-overlapping layer surfaces that both react to layer_enter events? I can imagine that causing weird feedback loops.

All use-cases we have right now should not cause any clients to resize/move their surfaces. So yeah, something to be aware of, but not an immediate issue.