Skip to content

fix(island): ensure auto-close triggers on Linux and add manual close button - #147

Closed
Totopo27 wants to merge 1 commit into
Louis-CFM:mainfrom
Totopo27:fix/linux-auto-close-and-close-button
Closed

Totopo27 wants to merge 1 commit into
Louis-CFM:mainfrom
Totopo27:fix/linux-auto-close-and-close-button

Conversation

@Totopo27

@Totopo27 Totopo27 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the issue where the island never auto-closes on Linux (KDE Plasma / GNOME) and provides a manual close button on the header as a reliable fallback.

Closes #136

Motivation & Root Cause

  1. On Linux, CURSOR_POLL is disabled (false) and window input shapes are applied directly via platform::set_input_region to match the island shape. Moving the cursor off the island moves it outside the window's input shape, so WebKitGTK / GDK stops receiving mouse events. window.addEventListener("mouseout") with e.relatedTarget == null fails to fire under Wayland/X11 compositors when leaving the input region, leaving this.wasInIsland = true permanently.
  2. When the island opened programmatically (alerts, task completion, or initial expansion), expand() reset this.homeCollapseAt = null, meaning the visual countdown never started unless the pointer first entered and exited the island.
  3. In updateCountdown(), when remaining <= 0, it only zeroed the progress bar width without calling this.collapse().
  4. While counting down to auto-close, this.frame would stop if no other animation was active (busy = false), halting updateCountdown entirely.

Key Changes

  • windows/src/island/island.ts:
    • In followPageCursor(), listen to document.mouseleave, window.blur, and this.islandEl.mouseleave to reliably deliver (-10000, -10000) when the cursor leaves the island or window focus shifts.
    • In expand() and alert(), schedule this.homeCollapseAt whenever opened while !this.wasInIsland && !State.isPinned.
    • In updateCountdown(), call this.collapse() when remaining <= 0.
    • In the animation loop, keep busy = true while homeCollapseAt != null so the countdown bar smoothly renders down to 0 and collapses.
  • windows/src/views/views.ts & windows/src/style.css:
    • Added a Close (Esc) button (ICONS.xmark) to .header-actions so users can instantly dismiss the island if needed.

Verification

  • npx tsc --noEmit clean.
  • npm run build completed cleanly.

Copy link
Copy Markdown
Owner

Thank you! Auto-close on Linux is now handled on main by #160 (a pointer watch that only runs while the island is shown), extended to regular windows on GNOME/X11 (#307). The ✕ button isn't merged: it changes the shipped header, which the repo keeps as is. It will ship with the next Linux release.


Generated by Claude Code

@Louis-CFM Louis-CFM closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto close not working on Linux (Fedora 43, KDE Plasma 6.7)

2 participants