Skip to content

wlr: expose layer surface state, configuration, iteration and keyboard focus clearing - #12

Merged
DeedleFake merged 3 commits into
masterfrom
layer-shell
Oct 1, 2026
Merged

DeedleFake merged 3 commits into
masterfrom
layer-shell

Conversation

@DeedleFake

@DeedleFake DeedleFake commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Plain bindings that kawa needs to support wlr-layer-shell clients in DeedleFake/kawa#17, such as panels, wallpapers, notifications and launchers. Right now kawa panics with Not implemented. as soon as one connects. Each commit wraps wlroots calls, fields and events with nothing added on top.

  • LayerSurfaceV1.Output, SetOutput, Namespace, Initialized, InitialCommit, Current and Pending read the matching wlr_layer_surface_v1 fields, and output can be written. A client may leave the output nil, and the compositor then has to pick one before the surface is configured.
  • LayerSurfaceV1State reads wlr_layer_surface_v1_state: committed, anchor, exclusive_zone, the four margins, keyboard_interactive, desired_width, desired_height and layer. The anchor, keyboard interactivity and committed field constants come with it. kawa lays surfaces out from this state and re-arranges when committed is non-zero.
  • LayerSurfaceV1.Configure, Destroy, ExclusiveEdge and OnDestroy wrap wlr_layer_surface_v1_configure, wlr_layer_surface_v1_destroy, wlr_layer_surface_v1_get_exclusive_edge and the destroy event. kawa configures each surface with its arranged size, takes exclusive zones off the edge wlroots reports, and closes surfaces when their output goes away.
  • LayerSurfaceV1.ForEachSurface, Surfaces, ForEachPopupSurface, PopupSurfaces and PopupSurfaceAt wrap wlr_layer_surface_v1_for_each_surface, wlr_layer_surface_v1_for_each_popup_surface and wlr_layer_surface_v1_popup_surface_at, in the same shape as the existing XDGSurface iterators. kawa uses them to draw a surface with its subsurfaces, to draw and hit test its popups above everything else, and to find the layer surface that a popup belongs to.
  • Seat.KeyboardNotifyClearFocus wraps wlr_seat_keyboard_notify_clear_focus. When a launcher that held the keyboard closes and there's no window left to give it to, kawa clears keyboard focus.

Verified with go build ./... and go vet ./... against wlroots 0.20.2, and by running kawa built against this branch in a nested session with swaybg, waybar (including its GTK menus and tooltips), mako, fuzzel and a gtk-layer-shell test panel on one and two outputs.

@DeedleFake
DeedleFake merged commit 8832710 into master Oct 1, 2026
2 checks passed
@DeedleFake
DeedleFake deleted the layer-shell branch October 1, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant