Commit Graph
5 Commits
Author SHA1 Message Date
gitops 79834620ad Ignore .omc/ operational artifacts
Matches the parent repo and the cosmic-session fork. These are runtime
scratch files; one was committed by accident earlier in this project.
2026-08-10 08:26:02 +07:00
gitops 09eb1717c4 Patch B: drive the .socket2 event stream
Emits openwindow/closewindow/activewindow/workspace by diffing a state
snapshot from lib.rs's existing throttled refresh, rather than instrumenting
window map/unmap and focus-change sites across shell/. One call plus one new
file, so the fork stays rebasable against the ~46 upstream commits a month
those files see.

The snapshot walk is skipped entirely when nothing is subscribed to .socket2,
which is every tick when no bar is running. The baseline is still updated so
a newly-connected client does not receive a burst of openwindow events for
windows that were already open.

Ordering follows Hyprland: openwindow before the activewindow that usually
accompanies it, closewindow after, so a client tracking windows by address
never sees an activewindow for one it has not been told about.

Known trade-off: a window opening and closing inside one 150ms tick produces
no events. Hyprland would emit both.

9 new tests driving a real socketpair through the actual broadcast path.
22 hypr_ipc tests pass.

Runtime-verified nested: subscribing to .socket2 and opening a window yields
  openwindow>>1,1,foot,foot / activewindow>>foot,foot
  activewindow>>, / closewindow>>1
2026-08-10 07:59:08 +07:00
gitops 1de9027b07 Patch B: Hyprland-compatible IPC socket
Binds .socket (request/response) and .socket2 (event stream) under
$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE, so waybar's
hyprland/workspaces and hyprland/window modules work unmodified. Both
listeners register on the existing calloop loop following session.rs's
run_socket pattern; nothing spawns a thread touching compositor state.

Wiring the agent documented but did not apply:
  - lib.rs calls hypr_ipc::init before announcing readiness, so the signature
    is exported in time for get_env to pass it to children. Failure is
    non-fatal; only waybar's hyprland/* modules go dark.
  - Common gains an Option<HyprIpcHandle>, None until the sockets bind.
  - session.rs get_env forwards HYPRLAND_INSTANCE_SIGNATURE alongside
    WAYLAND_DISPLAY, which is how waybar finds the socket.

cargo check passes clean; 13 hypr_ipc unit tests pass, covering the JSON
field names, event-line formats and command parsing. Full lib suite: 14
passed, 0 failed.

NOT runtime-verified — no Wayland session available here, so nothing confirms
waybar actually consumes these sockets.

Event notifications are inert until notify_* is called from focus-change
sites; request/response works without that.
2026-08-10 07:44:29 +07:00
gitops 84bdd3b9df Patch A: zwlr_foreign_toplevel_management_v1
Implements the wlr foreign-toplevel management protocol on top of the
existing ToplevelInfoState/ToplevelManagementHandler, so waybar's wlr/taskbar
module works. cosmic-comp previously shipped only ext-foreign-toplevel-list,
which enumerates but cannot activate or close.

The wlr manager state is constructed alongside ForeignToplevelListState and
driven from the same new_toplevel/remove_toplevel/refresh hooks, so no
separate registration in state.rs is needed.

Accessors global_id and registered_toplevels moved to an unbounded impl
block: adding the wlr dispatch bounds to the shared impl made them viral and
broke overlap_notify.rs, which needs neither.

cargo check passes clean. NOT runtime-verified — no Wayland session here.
2026-08-09 23:07:10 +07:00
d 6ce5e75b0b Fork of pop-os/cosmic-comp @ upstream 2026-08-09 22:37:21 +07:00