Skip to content

Add custom power icon font to replace circle-slash - #7

Merged
danisss9 merged 2 commits into
mainfrom
claude/mouse-click-power-icon-45rwmv
Aug 7, 2026
Merged

danisss9 merged 2 commits into
mainfrom
claude/mouse-click-power-icon-45rwmv

Conversation

@danisss9

@danisss9 danisss9 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a custom icon font (vscodeos-icons.woff) containing an IEC 5009 power symbol to replace the inadequate circle-slash codicon in the status bar power button. The power symbol is drawn to match codicon's metrics for visual consistency.

Key Changes

  • New icon font generator (extension/media/icons/build-font.py): Python script that generates a single-glyph WOFF font containing the IEC 5009 power symbol using fontTools. The glyph is carefully designed with:

    • 300 units per em (matching codicon)
    • 19-unit stroke width (matching codicon outlines)
    • Quadratic Bezier arc approximation in 15-degree steps for smooth curves
    • Deterministic build timestamp to avoid unnecessary diffs on re-runs
  • Icon registration (extension/package.json): Registered the custom power icon under contributes.icons as vscodeos-power, pointing to the generated font at character U+E000

  • Status bar update (extension/src/statusbar/index.ts): Changed power button icon from $(circle-slash) to $(vscodeos-power) with updated comments explaining why a custom font was necessary

  • Build script update (scripts/build-extension.sh): Added installation of the .woff font file to the packaged extension

  • Documentation (extension/README.md): Added explanation of why the custom font exists and how it's generated

  • Openbox config fix (rootfs-common/etc/skel/.config/openbox/rc.xml): Removed problematic Frame context mouse binding that was consuming left-clicks in the editor; added detailed comment explaining X11 grab semantics and why Frame bindings must be modifier-prefixed

Implementation Details

The power glyph uses a broken ring (IEC 5009 standard) with a vertical bar through the gap. Arcs are approximated with quadratic Bezier curves, achieving worst-case radial error of 0.005 units (~0.0003 pixels). The font is committed to the repository; the generator script only needs to run when the glyph design changes.

https://claude.ai/code/session_01K67j2gUu6CKtsw7RisXrFc

claude added 2 commits August 7, 2026 15:39
The Openbox mouse policy bound a bare Left press in the Frame context. That
one line swallowed every left click in VS Code while the right and middle
buttons kept working, because Openbox grabs the two window contexts with
different pointer modes (openbox/mouse.c, mouse_grab_for_client):

    Frame   grab on the frame window, GrabModeAsync
    Client  grab on the client window, GrabModeSync

Only the synchronous grab is replayed - mouse_replay_pointer() calls
XAllowEvents(ReplayPointer) "to send the event through to the client", and
mouse.c arms it for the client context alone. The asynchronous grab on the
frame consumes the press. On top of that the frame is the client window's
parent, and X activates the outermost of two competing passive grabs, so the
Frame binding also stopped the Client one from ever firing.

Drop the Frame context. Click-to-focus already came from the Client bindings,
which are what upstream's rc.xml uses bare buttons for; upstream binds only
modifier combinations (A-Left and friends) under Frame, for exactly this
reason. The comment left behind says why, so it does not get added back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K67j2gUu6CKtsw7RisXrFc
The tray's power button drew $(circle-slash), a circle with a diagonal bar
through it - a "no entry" sign, not a power symbol. None of codicon's 753
icons is one, so the glyph now comes from a one-glyph font of the shell's
own, registered through contributes.icons and used as $(vscodeos-power).

It is IEC 5009: a ring broken at the top with a bar rising through the gap.
media/icons/build-font.py generates it to codicon's own metrics - 300 units
per em, a 19-unit stroke, optically centred on the 16 px box - so it sits at
the same size, weight and baseline as the $(plug) and $(volume) glyphs beside
it. The woff is 956 bytes and is committed; the generator needs fonttools and
only runs if the glyph itself changes, and it pins the head timestamps so a
rebuild of an unchanged glyph is a byte-identical file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K67j2gUu6CKtsw7RisXrFc
@danisss9
danisss9 merged commit 7326bfb into main Aug 7, 2026
5 checks passed
@danisss9
danisss9 deleted the claude/mouse-click-power-icon-45rwmv branch August 7, 2026 15:57
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.

2 participants