Issue: Cannot close review window on Hyprland (wlroots layer-shell has no title bar)
Problem
On wlroots-based Wayland compositors (tested on Hyprland), the /diff-review window cannot be closed by the user:
- No title-bar × button: the window has no decorations
super+Q / Alt+F4 / Esc don't work: it isn't a regular toplevel, so
compositor window actions (killactive, closewindow) don't apply
- The escape is killing the glimpse process (
pkill -f glimpse), reload the extension or ending the pi session
Reproduce
- Run pi on Hyprland (Wayland)
- Execute
/diff-review
- Try to close the review window, there is no × button, and keyboard shortcuts (Esc, Alt+F4, super+Q) do nothing
Environment
- pi-review-loop: 0.3.0 (commit
3822e12)
- Compositor: Hyprland (Wayland)
- OS: Arch Linux
- glimpse backend: native (default;
src/glimpse binary present)
Root cause
glimpse's native Linux backend renders the window as a layer-shell Overlay surface via gtk4-layer-shell, which by design carries no window decorations (no title bar, no × button) and is not managed as a regular toplevel by the compositor:
// glimpseui src/linux/src/main.rs:115-117
window.init_layer_shell();
window.set_layer(Layer::Overlay);
window.set_exclusive_zone(-1);
This is appropriate for glimpse's intended use (companion/overlay windows), but it leaves the review window with no affordance to close. glimpse does expose a close API (window.glimpse.close() → __glimpse_close → app.quit() at main.rs:218), but review-loop never calls it, there is no close button in the UI and no keyboard binding.
This only affects wlroots compositors. On macOS / Windows / X11 / GNOME-Wayland, gtk4-layer-shell falls back to a normal decorated toplevel (those compositors don't implement wlr-layer-shell), so the system × button is present.
Expected behavior
The review window should be closable on all platforms. On wlroots (where there is no system title bar), review-loop should provide its own in-page close button, since the window lacks native window decorations.
Note
I have a fix ready: detect Hyprland in the bridge via process.env.HYPRLAND_INSTANCE_SIGNATURE, inject a flag into the page HTML, and reveal an in-page × button wired to glimpse's existing window.glimpse.close() API. If this approach sounds reasonable, hope the PR can be given some consideration.
Issue: Cannot close review window on Hyprland (wlroots layer-shell has no title bar)
Problem
On wlroots-based Wayland compositors (tested on Hyprland), the
/diff-reviewwindow cannot be closed by the user:super+Q/Alt+F4/Escdon't work: it isn't a regular toplevel, socompositor window actions (killactive, closewindow) don't apply
pkill -f glimpse), reload the extension or ending the pi sessionReproduce
/diff-reviewEnvironment
3822e12)src/glimpsebinary present)Root cause
glimpse's native Linux backend renders the window as a layer-shell
Overlaysurface viagtk4-layer-shell, which by design carries no window decorations (no title bar, no × button) and is not managed as a regular toplevel by the compositor:This is appropriate for glimpse's intended use (companion/overlay windows), but it leaves the review window with no affordance to close. glimpse does expose a close API (
window.glimpse.close()→__glimpse_close→app.quit()atmain.rs:218), but review-loop never calls it, there is no close button in the UI and no keyboard binding.This only affects wlroots compositors. On macOS / Windows / X11 / GNOME-Wayland,
gtk4-layer-shellfalls back to a normal decorated toplevel (those compositors don't implementwlr-layer-shell), so the system × button is present.Expected behavior
The review window should be closable on all platforms. On wlroots (where there is no system title bar), review-loop should provide its own in-page close button, since the window lacks native window decorations.
Note
I have a fix ready: detect Hyprland in the bridge via
process.env.HYPRLAND_INSTANCE_SIGNATURE, inject a flag into the page HTML, and reveal an in-page × button wired to glimpse's existingwindow.glimpse.close()API. If this approach sounds reasonable, hope the PR can be given some consideration.