A second click on the Control Center widget doesn't close Control Center

Đang mở Phù hợp với người mới
#998 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@MaHofseth đang làm issue này rồi.

Từ ngày 4/12/2026.

  • #999 của @MaHofseth — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
macos, swift
Lĩnh vực
backend, desktop

Hướng nghiên cứu

Bắt đầu trong Sources/StableBar/MenuBar/AppMenu.swift, đọc openControlCenter() và kiểm tra showsPanel của hàm này cùng với issue #311. Tái hiện bằng cách thêm widget controlCenter, sau đó nhấp vào nó hai lần trên macOS; lần nhấp thứ hai sẽ đóng Trung tâm điều khiển. Cũng kiểm tra hành vi trên macOS 26 và các phiên bản cũ hơn, vì issue cho biết những phiên bản đó chưa được kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs-triage

What happens

A click on the controlCenter widget opens macOS Control Center. A second click on the widget does nothing: the panel stays open until a click lands somewhere else.

Steps to reproduce

  1. Add a controlCenter widget to the bar.
  2. Click it. Control Center opens.
  3. Click it again.

Expected

The second click closes Control Center, as a click on Control Center's own menu bar item does. #311 lists this in its checks: "Clicking the ellipsis or the Control Center button again closes what it opened."

Environment

  • StableBar 0.20.0, and a build of main at e3b72d9
  • macOS 27.2.1
  • One display, AeroSpace running

Evidence

Probes on macOS 27.2.1:

  • A click on the bar while Control Center's panel shows reaches the bar and leaves the panel open. macOS does not treat it as a click outside the panel.
  • A second press of the Control Center menu bar item closes the panel.
  • A press during the panel's fade-out, about 300 ms, is ignored.

Diagnosis

AppMenu.openControlCenter() in Sources/StableBar/MenuBar/AppMenu.swift returns early when showsPanel finds Control Center's panel on screen. #311 added that guard so that the click that closes the panel doesn't reopen it, which assumes macOS closes the panel on that click. On macOS 27.2.1 it doesn't, so the guard swallows the second click and nothing closes the panel.

Removing the guard, so every click presses the menu bar item, makes the widget a toggle on macOS 27.2.1. Not checked on macOS 26 and earlier, where the click on the bar may still close the panel by itself.

Related

  • #311 added the widget and the guard.
  • #620 and #622 are about the native menu bar showing when Control Center opens, a different problem.
  • pressUnlessOpen in the same file has the same "already open, do nothing" check for Menu bar items; not checked here.

Triaged by Claude Code (Claude Fable 5.2).

Ngôn ngữ chính
Swift
Star
184
Fork
12
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Seb-GRAF/StableBar

Tất cả issue của Seb-GRAF/StableBar

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.