Skip to content

fix(linux): reliable tray panel clicks and bottom-tray positioning - #26

Merged
symonbaikov merged 1 commit into
mainfrom
feat/linux-window-issues-b6772d
Aug 28, 2026
Merged

symonbaikov merged 1 commit into
mainfrom
feat/linux-window-issues-b6772d

Conversation

@symonbaikov

@symonbaikov symonbaikov commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes the three reported Linux panel problems: the panel being unclickable or closing on any click inside it, always opening at the top of the screen even when the tray is docked at the bottom, and general sluggishness.

  • Removed the full-screen click-catcher overlay (panel_non_macos.rs, App.tsx, capability). It was an extra transparent always-on-top webview covering all monitors; on many WMs it stacked above the panel, so clicks either did nothing or instantly hid the panel. The existing focus-loss handler already closes the panel when clicking elsewhere. Dropping it also removes a whole extra WebKit process per panel open (responsiveness/RAM win).
  • Bottom-tray support (panel_geometry.rs): if the panel does not fit below the anchor, it opens upward with its bottom at the tray icon top. A new panel:anchor-edge event flips the arrow to the bottom of the panel, pointing down (use-panel.ts, app-shell.tsx, index.css). Anchors now carry the icon top edge (topY) through the tray rect, the GNOME anchor extension, and POST /v1/linux-panel/open|anchor (optional field, backward compatible).
  • Cursor-edge fallback (panel.rs): with no tray rect and no GNOME anchor (e.g. KDE), the panel anchors to the cursor position — but only when the cursor is within 96px of the top/bottom screen edge, where trays live. The global shortcut with the cursor mid-screen still uses the safe top-right fallback. Order: GNOME anchor → cursor near edge → top-right.
  • Dropped eprintln! debug spam from the positioning hot path.

On Wayland compositors set_position/always-on-top remain advisory; behavior there is unchanged (best effort), X11 gets the full fix.

Related Issue

None filed; issues reported directly (Linux panel unclickable / closes on click / wrong edge).

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass (1154 frontend; 75 Rust incl. 10 new/updated geometry tests; tsc --noEmit clean)
  • I tested the change locally with bun tauri dev (KDE Plasma Wayland: builds, runs, POST /v1/linux-panel/open positions via the new anchor path)

Screenshots

The only visual delta is the arrow moving to the bottom of the panel (pointing down) when the tray is bottom-docked. Could not capture a clean shot on the Wayland test machine — the compositor refuses programmatic window activation, and full-screen captures contained unrelated personal content. If needed before merge, an X11 session with a bottom panel would demonstrate it.

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

🤖 Generated with Claude Code

- Remove the full-screen click-catcher overlay window: on many WMs it
  stacked above the panel, eating clicks or closing the panel on any
  click inside it. Focus-loss handling already closes the panel, and
  dropping the overlay also removes an extra WebKit process.
- Support bottom-docked trays: the panel now opens upward when it does
  not fit below the anchor, with the arrow flipped to point down
  (panel:anchor-edge event). Anchors carry the icon top edge (topY) via
  tray rect, GNOME extension, and the local HTTP API.
- Fallback positioning without a tray rect now uses the cursor position
  when it is near a top/bottom screen edge (where trays live), instead
  of always the top-right corner; edge gating keeps the global shortcut
  from popping the panel mid-screen.
- Drop eprintln! debug spam from the positioning hot path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@symonbaikov
symonbaikov merged commit 3841fd3 into main Aug 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant