Menu bar items drawn as in the menu bar show the wrong part of the menu bar after a display change

オープン
#820 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Jonathanm10 がすでに取り組んでいます。

2026年11月18日 から。

  • #822 @Jonathanm10 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
macos, swift
領域
desktop, frontend

調査の方向性

Start with Sources/StableBar/MenuBarItemMirror.swift and trace how it caches SCWindow frames and chooses a window for capture. Compare those listed frames with the window server’s current bounds before capturing, then refresh the list when they differ. Done means live menu bar items remain aligned after a display disconnect or resolution change; issue #822 has an open linked pull request.

索引モデルが issue の本文から書いたものです。

説明

needs-triage
What happens

Items of a Menu bar items widget shown As in the menu bar ("display": "live") draw a slice of the macOS menu bar that belongs to other items after a display is disconnected or changes resolution. On a MacBook whose ultrawide monitor was unplugged, CodexBar's place on the bar showed the ChatGPT and MeetingBar icons and MeetingBar's place showed part of the Wi‑Fi and Sound icons. Each picture still opens its own item, so clicking the MeetingBar icon opens CodexBar and clicking the speaker opens MeetingBar. It stays that way until StableBar restarts.

Steps to reproduce
  1. On macOS 27, show two neighboring menu bar items on the bar with As in the menu bar, such as CodexBar and MeetingBar.
  2. Start StableBar while the display's menu bar is shorter than it will be later: on an external display without a notch (30 pt menu bar), or with the built-in display at a smaller "Looks like" resolution such as 1352 × 845.
  3. Disconnect the external display, or switch back to the default resolution (1512 × 982, 33 pt menu bar on a notched MacBook).
Expected

Each item shows what it shows in the macOS menu bar, at any display arrangement.

Environment

StableBar 0.18.0-beta.20261118082113.1362, macOS 27.2.1, MacBook Pro built-in display, ultrawide external monitor (3440 pt wide).

Evidence
  • The bar's log after the change shows ScreenCaptureKit capturing MenuBarAgent's window 118495 with frame=(0,0,3440,30) every two seconds, while the window server reports the same window at (0,0,1512,33).
  • Reproduced with the built-in display alone: started the installed build at 1352 × 845, switched to 1512 × 982 and captured the bar: its live items showed fragments of the neighboring icons. A build with the fix drew them correctly in the same run.
Diagnosis

MenuBarItemMirror (Sources/StableBar/MenuBarItemMirror.swift) keeps the SCWindows it listed and lists again only when none of their frames contains the item. MenuBarAgent keeps the same window when displays change and resizes it, so the cached frame still contains the item and is never refreshed. The capture uses that frame for its size, which scales the image (here by 30/33), so every item's crop lands about 9% too far right. It only shows when the window grows taller than when it was listed; a smaller window leaves the crops in place.

Fix: compare the listed frames with the window server's current bounds before capturing, and list again when they differ.

Related

#640 added the live copies. #799 asks for a widget-wide Show setting, unrelated.

Triaged by Claude Code (claude-opus-5-5).

主要言語
Swift
スター
184
フォーク
12
平均マージ
3時間 50分
マージ済み PR(30日)
387

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Seb-GRAF/StableBar のほかの issue

Seb-GRAF/StableBar の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。