0049: Clicks pass through the call bar's gaps

On this page

Status: accepted

Context

The call bar is a see-through window sized to the bar plus room for what opens beside it: notes and asks, menus, and the tooltips of a standing bar (0047). Every pixel of that window took clicks, so a desktop icon or a window next to the bar couldn't be clicked, and picking a window to hide missed clicks under it. A standing bar grew its window while the pointer was on it, for its tooltips, which moved the bar slightly.

Decision

  • The page says where it can be clicked. It sends the shell the boxes of the bar (or its pill), the notes and asks beside it, and whether a button is held (pair_bar_hit).
  • The shell follows the pointer. While the bar is open, a thread reads the pointer's position about 60 times a second and makes the window ignore the pointer (set_ignore_cursor_events) when it's more than 8 px from every box. While a menu is open, a button is held or the bar is dragged, the whole window takes clicks, so a click beside a menu closes it and a drag never loses its release.
  • A standing bar keeps its room. Its window always has the room beside it, where clicks pass through, so pointing at the bar never resizes the window.

Consequences

  • What's beside the bar can be clicked, on macOS and Windows alike.
  • Before the page has said where it can be clicked, or when the pointer's position can't be read, the whole window takes clicks, as before.
  • Hover effects on the bar start a frame after the pointer reaches it, since the window ignored the pointer until then.
  • One thread runs for the bar's life, waking every 16 ms.