Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
T
Tidal
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • PLN
  • Tidal
  • Repository

Switch branch/tag
  • Tidal
  • tools
  • rig_units.py
Find file
BlameHistoryPermalink
  • PLN (Algolia)'s avatar
    feat(midiviz): an X that closes it, a [x] that pins it, and a close that sticks · 46709b26
    PLN: "needs basic menu or at least top right X to close, and its too sticky
    atm if i close i wanna close it i guess maybe X and a [x] where x goes and
    comes and is the 'stick above' feature, but it anyway is all desks always."
    
    No menu -- two glyph targets in the header's right edge, in the same micro
    font as everything else: "[x]" toggles always-on-top (the x IS the state) and
    "X" closes. Dim by default, brighter under the pointer, which is the only
    affordance a frameless window can offer. T toggles the pin from the keyboard;
    Q and Escape already closed it and still do.
    
    Controls win over the drag. The whole surface is a drag handle, so without an
    explicit hit-test first the X would only ever have moved the window.
    
    Targets are laid out from the right edge with the glyphs centred inside them,
    not sized to fit the glyphs. Sizing to the glyph gave an 8px-wide X --
    measured -- which is fine to look at and unhittable mid-set, and at 0.6 scale
    the two targets then had to either overlap or shrink below usable. Deciding
    targets first makes "disjoint and at least 18px" true by construction at every
    zoom, asserted across four scales and three widths.
    
    All-desktops is deliberately untouched: it is a KWin rule keyed on the app id,
    it is unconditional as PLN said, and toggling the pin must not disturb it.
    
    THE STICKINESS WAS NOT THE WINDOW. A clean exit is not a failure so systemd
    never restarted it -- but rig_units.ensure() starts every non-manual unit that
    is not active, and both gig-up and the Bridge watcher converge, so the lens
    came straight back with nothing in the output admitting why. Marking the unit
    "manual" would have answered the complaint by deleting the feature he asked
    for last week.
    
    So a deliberate close is recorded in $XDG_RUNTIME_DIR, ensure() honours the
    latch and says so, and anything that starts the lens on purpose clears it.
    That directory is wiped at logout, which is exactly the right lifetime:
    "always open" is about how a session starts, "closed means closed" is about
    what happens after he acts, and the two only looked contradictory. Closed for
    this session, back at next login, no state to remember to undo. Only a close
    the human asked for latches -- a compositor teardown is not an opinion.
    
    The latch path is a contract between three files that deliberately do not
    import each other, so a test asserts they agree rather than trusting three
    copies of an f-string. That test immediately earned its keep: rig_units.py
    used Path without importing it, on a line only reached once a latch existed.
    
    Also fixes a shadow of my own making: the new painter was called
    _paint_chrome, which is already a method on this widget, so it silently
    replaced the window-chrome painter and the selftest died on the signature.
    Renamed _paint_controls.
    PLN (Algolia) authored Sep 05, 2026
    46709b26
rig_units.py 14.1 KB
EditWeb IDE
×

Replace rig_units.py

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.