GtkPopover

Odysseus’s “status icons” are all associated with a popover, even if that popover just displays what was going to show up in it’s tooltip. And forthermore I use a popover to autocomplete whatever you type in the addressbar.

(Yes GTK has a widget for autocompletions, but I haven’t managed to feed it “live” completions)

The GtkPopover widget has two main tasks: wrapping a GdkSurface and rendering an arrow.

Rendering that arrow also involves making space for it, and an event from GdkSurface determines on which side it renders that arrow.

GdkSurface is mostly just a (partial) wrapper around the windowing protocol it managed to open, whilst caching properties and normalising events.

Though it does implement logic for computing and applying the position of GtkPopovers in case the server doesn’t, once .move_to_rect() is called. Basically this just a matter of adjusting the initial guess until it fits inside the bounding box of the containing monitor.