Explore using xdg-popup for jump labels #443

Closed
opened 7 months ago by dnkl · 1 comments
dnkl commented 7 months ago
Owner

We're currently rendering jump labels using subsurfaces. It's not exactly what they (subsurfaces) were meant for. For example, the spec is currently somewhat unclear on whether subsurfaces extending outside the window geometry should be clipped or not, as is evident from https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/24.

TL;DR gtk3 uses sub-surfaces for popups, and assumes they will be rendered, even if extending outside the window geometry. Gtk4 was "fixed" and uses xdg-popups instead, and it seems the general opinion is that subsurfaces extending outside the window geometry should be (allowed to be) clipped.

As such, we have two options: continue using sub-surfaces, but try to keep them inside the window geometry. Or, switch to xdg-popups. I think we should explore xdg-popups first, and keep using subsurfaces only if xdg-popups proves to be an even worse fit.

We're currently rendering jump labels using subsurfaces. It's not exactly what they (subsurfaces) were meant for. For example, the spec is currently somewhat unclear on whether subsurfaces extending outside the window geometry should be clipped or not, as is evident from https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/24. TL;DR gtk3 uses sub-surfaces for popups, and assumes they will be rendered, even if extending outside the window geometry. Gtk4 was "fixed" and uses xdg-popups instead, and it seems the general opinion is that subsurfaces extending outside the window geometry should be (allowed to be) clipped. As such, we have two options: continue using sub-surfaces, but try to keep them inside the window geometry. Or, switch to xdg-popups. I think we should explore xdg-popups first, and keep using subsurfaces only if xdg-popups proves to be an even worse fit.
dnkl added the
enhancement
label 7 months ago
Poster
Owner

Reading through the xdg-popup interface, and it's intended usage, I don't think it's a good fit for our jump labels.

Popups are intended for context menus and similar, and are therefore more like sub-windows, with their own input handling. They are also dealt with in a way similar to toplevel windows (i.e. they have configure events, need to respond to ping events etc). They can also be dismissed by the compositor.

On top of that, or perhaps, because of that, managing them is a much more complex task than managing sub-surfaces.

For this reason, I've decided to continue using sub-surfaces, but try much harder to keep them inside the window geometry.

Reading through the xdg-popup interface, and it's intended usage, I don't think it's a good fit for our jump labels. Popups are intended for context menus and similar, and are therefore more like sub-**windows**, with their own input handling. They are also dealt with in a way similar to toplevel windows (i.e. they have configure events, need to respond to ping events etc). They can also be dismissed by the compositor. On top of that, or perhaps, _because_ of that, managing them is a much more complex task than managing sub-surfaces. For this reason, I've decided to continue using sub-surfaces, but try much harder to keep them inside the window geometry.
dnkl closed this issue 7 months ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.