Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0119776095
|
||
|
|
a153e89d84
|
||
|
|
a6c044f009
|
||
|
|
b7377e424e
|
||
|
|
0eb8fc5c4e
|
||
|
|
dbb19caaf8
|
||
|
|
8b647982ef
|
||
|
|
e6c0c14d1b
|
||
|
|
15ef5d52d0
|
||
|
|
7032285d13
|
||
|
|
5d109790c8
|
No files matched your search
@@ -34,7 +34,7 @@ ELYTerminal. A terminal on GPUI and Ely components. `PRD.md` says what it does;
|
|||||||
|
|
||||||
- `build.rs`: on Windows, the icon into the executable as resource 1, through `assets/icons/elyterminal.rc`. `.cargo/config.toml`: Windows builds carry the C runtime. `rust-toolchain.toml`: the toolchain rustup installs.
|
- `build.rs`: on Windows, the icon into the executable as resource 1, through `assets/icons/elyterminal.rc`. `.cargo/config.toml`: Windows builds carry the C runtime. `rust-toolchain.toml`: the toolchain rustup installs.
|
||||||
- `src/main.rs`: start. `src/lib.rs`: the modules, public so tests and examples reach them. `src/app.rs`: fonts, settings, integration, then the main window, at the size the settings keep, which it keeps as it settles. `src/menus.rs`: the menu bar, the keys of Quit, the font's size and Minimize, and what they do. `src/blur.rs`: what the window shows of the desktop, from the opacity and blur settings, set as they change; `blur/macos` gives gpui's NSVisualEffectView a material that blurs; `blur/wayland` asks a Wayland compositor for blur behind the window's surface through `ext_background_effect_v1`; `blur/x11` names the window's pane in `_KDE_NET_WM_BLUR_BEHIND_REGION`. `src/workspace.rs`: the window's content, Ely's `ColumnShell` with the sessions, terminal and right columns, their toggles, the right column's Git and Files switch, the title, and the sessions' lifecycle. `src/workspace/widths.rs`: the side columns' widths, which a drag on their border sets and the settings keep once it rests. `src/workspace/events.rs`: what a session's terminal reports: title, folder, bell, the state its row shows, the program's exit; and a press on a notification a session posted. `src/sessions.rs`: a session and its row, with the mark of its status and what hover shows of it; `sessions/orb` draws the mark, 3 by 3 dots on one clock. `src/files.rs`: the Files panel, the shown session's folder as Ely's `Tree` with Git's marks. `src/git.rs`: git through its command line: Files' marks, and the Git panel's status, stage, unstage, discard, commit and log; `src/git/diff.rs` reads git's diff into Ely's stretches. `src/git/panel.rs`: the Git panel's state and actions; `src/git/panel/view.rs`: how it draws.
|
- `src/main.rs`: start. `src/lib.rs`: the modules, public so tests and examples reach them. `src/app.rs`: fonts, settings, integration, then the main window, at the size the settings keep, which it keeps as it settles. `src/menus.rs`: the menu bar, the keys of Quit, the font's size and Minimize, and what they do. `src/blur.rs`: what the window shows of the desktop, from the opacity and blur settings, set as they change; `blur/macos` gives gpui's NSVisualEffectView a material that blurs; `blur/wayland` asks a Wayland compositor for blur behind the window's surface through `ext_background_effect_v1`; `blur/x11` names the window's pane in `_KDE_NET_WM_BLUR_BEHIND_REGION`. `src/workspace.rs`: the window's content, Ely's `ColumnShell` with the sessions, terminal and right columns, their toggles, the right column's Git and Files switch, the title, and the sessions' lifecycle. `src/workspace/widths.rs`: the side columns' widths, which a drag on their border sets and the settings keep once it rests. `src/workspace/events.rs`: what a session's terminal reports: title, folder, bell, the state its row shows, the program's exit; and a press on a notification a session posted. `src/sessions.rs`: a session and its row, with the mark of its status and what hover shows of it; `sessions/orb` draws the mark, 3 by 3 dots on one clock. `src/files.rs`: the Files panel, the shown session's folder as Ely's `Tree` with Git's marks. `src/git.rs`: git through its command line: Files' marks, and the Git panel's status, stage, unstage, discard, commit and log; `src/git/diff.rs` reads git's diff into Ely's stretches. `src/git/panel.rs`: the Git panel's state and actions; `src/git/panel/view.rs`: how it draws.
|
||||||
- `src/pet.rs`: Ely, peeking over the main window's top edge from a window of her own while the settings want her; she draws at every frame the display gives her window; `pet/rig` draws her from the icon's paths in layers of one color, each moved by a matrix of its own, as the films rig her; `pet/look` reads her mood from the sessions' marks and her pose at each moment of it, `look/curves` the timings of her moves; and `pet/macos`, `pet/windows` and `pet/x11` keep her window on the main window's edge where the platform does not.
|
- `src/pet.rs`: Ely, peeking over the main window's top edge from a window of her own while the settings want her, or up from its bottom edge where no room lies above it; she draws at every frame the display gives her window; `pet/rig` draws her from the icon's paths in layers of one color, each moved by a matrix of its own, as the films rig her; `pet/look` reads her mood from the sessions' marks and her pose at each moment of it, `look/curves` the timings of her moves; and `pet/macos`, `pet/windows` and `pet/x11` keep her window on the main window's edge where the platform does not.
|
||||||
- `src/settings`: the model, its ranges, and `SettingsStore`, the global that loads, checks and saves `settings.json`; `window` is the settings window, `window/appearance` its Appearance page, `window/terminal` its Terminal page. `tests/fonts.rs` brings its own main: gpui builds its Mac platform only on the main thread.
|
- `src/settings`: the model, its ranges, and `SettingsStore`, the global that loads, checks and saves `settings.json`; `window` is the settings window, `window/appearance` its Appearance page, `window/terminal` its Terminal page. `tests/fonts.rs` brings its own main: gpui builds its Mac platform only on the main thread.
|
||||||
- `src/themes`: built-in terminal themes, the chrome palette each maps to, and `apply`, which dresses the app for the system's appearance; `omarchy`, on Linux, wears Omarchy 4's current theme and follows its switches.
|
- `src/themes`: built-in terminal themes, the chrome palette each maps to, and `apply`, which dresses the app for the system's appearance; `omarchy`, on Linux, wears Omarchy 4's current theme and follows its switches.
|
||||||
- `src/term`: the terminal engine. `pty` starts a program through alacritty's event loop; `tap` wraps the pty so its reader scans OSC 0, 2, 7, 9, 99, 133, 777 and 7501, the title stack's CSI 22 t and 23 t, full resets, the mouse modes and, on Windows, win32-input-mode (`tap/modes`) before the parser; `titles` keeps the title a session shows, read in the output's order; `marks` reads OSC 133's prompt marks; `status` reads OSC 7501 and keeps a terminal's records; `notify` reads OSC 9, 777 and 99, the notifications and OSC 9;4's progress, and gathers OSC 99's chunks; `reports` is the view's side of what programs report: it keeps OSC 7501's records, maps OSC 9;4, answers OSC 99's query and alive, and posts the system notifications its session posts; `prompts` turns each mark into an OSC 8 link the parser keeps in a prompt's cells, and finds the prompt to jump to; `herdr` follows herdr's focused pane and its agents' states through herdr's socket while herdr's client runs in the session, and tells the view herdr leads, so herdr opens its links: `herdr/unix` finds the client leading the pty's foreground, `herdr/windows` under the session's shell, and asks its named pipe. `unix` starts the program itself, so a failed `chdir` fails the start; Windows uses alacritty's ConPTY. `shell` writes the integration scripts at start and builds each shell's launch. `frame` reads the grid into styled rows, `boxes` turns box drawing, block elements and powerline arrows into rects and polygons (`boxes/outline` strokes curves and diagonals into polygons), `ink` resolves colors, `paint` draws rows, decorations and the cursor, `view` is the entity: pty events, metrics, blink, resize. `zoom` holds the points Bigger and Smaller add to the Size setting, unsaved. `keys` turns key events into bytes, the kitty protocol and, in `keys/legacy`, xterm's encoding, with no gpui types; `input` is the view's key listeners, the bindings that keep Tab and F6 from Ely's focus moves, and its IME handler; `mac` reads the Option side, the repeat flag and the key code of AppKit's current event, and the key's own character from the layout, as gpui reads key names; it keeps held keys repeating, and hands Command key-ups to the focused view. `win32` sends a key as Windows' own record, win32-input-mode, and finds a key's own character in Windows' layout. `mouse` encodes mouse reports, with no gpui types; `links` finds the link at a cell; `pointer` is the view's mouse listeners: selection, reports, wheel, links, copy and paste. `find` is the find box: Ely's `FindWidget`, and Ely's `find_all` over the grid's shown text.
|
- `src/term`: the terminal engine. `pty` starts a program through alacritty's event loop; `tap` wraps the pty so its reader scans OSC 0, 2, 7, 9, 99, 133, 777 and 7501, the title stack's CSI 22 t and 23 t, full resets, the mouse modes and, on Windows, win32-input-mode (`tap/modes`) before the parser; `titles` keeps the title a session shows, read in the output's order; `marks` reads OSC 133's prompt marks; `status` reads OSC 7501 and keeps a terminal's records; `notify` reads OSC 9, 777 and 99, the notifications and OSC 9;4's progress, and gathers OSC 99's chunks; `reports` is the view's side of what programs report: it keeps OSC 7501's records, maps OSC 9;4, answers OSC 99's query and alive, and posts the system notifications its session posts; `prompts` turns each mark into an OSC 8 link the parser keeps in a prompt's cells, and finds the prompt to jump to; `herdr` follows herdr's focused pane and its agents' states through herdr's socket while herdr's client runs in the session, and tells the view herdr leads, so herdr opens its links: `herdr/unix` finds the client leading the pty's foreground, `herdr/windows` under the session's shell, and asks its named pipe. `unix` starts the program itself, so a failed `chdir` fails the start; Windows uses alacritty's ConPTY. `shell` writes the integration scripts at start and builds each shell's launch. `frame` reads the grid into styled rows, `boxes` turns box drawing, block elements and powerline arrows into rects and polygons (`boxes/outline` strokes curves and diagonals into polygons), `ink` resolves colors, `paint` draws rows, decorations and the cursor, `view` is the entity: pty events, metrics, blink, resize. `zoom` holds the points Bigger and Smaller add to the Size setting, unsaved. `keys` turns key events into bytes, the kitty protocol and, in `keys/legacy`, xterm's encoding, with no gpui types; `input` is the view's key listeners, the bindings that keep Tab and F6 from Ely's focus moves, and its IME handler; `mac` reads the Option side, the repeat flag and the key code of AppKit's current event, and the key's own character from the layout, as gpui reads key names; it keeps held keys repeating, and hands Command key-ups to the focused view. `win32` sends a key as Windows' own record, win32-input-mode, and finds a key's own character in Windows' layout. `mouse` encodes mouse reports, with no gpui types; `links` finds the link at a cell; `pointer` is the view's mouse listeners: selection, reports, wheel, links, copy and paste. `find` is the find box: Ely's `FindWidget`, and Ely's `find_all` over the grid's shown text.
|
||||||
@@ -108,4 +108,6 @@ ELYTerminal. A terminal on GPUI and Ely components. `PRD.md` says what it does;
|
|||||||
- 2026-10-17: a session posts system notifications through gpui's, which the owner asked for. At start `set_app_identity` names the app: on Windows that sets the process's AppUserModelID, which the taskbar groups its windows by too, so a pin made before may show apart, and the first notification writes the app's name under `HKCU\Software\Classes\AppUserModelId`, as gpui needs for an app without a package; on macOS gpui posts only from the app bundle, asks for leave at the first, and logs once, under the `gpui_macos` target, that it posts nothing outside one; on Linux it posts over D-Bus through notify-rust. Each terminal view posts its own, in the order its output asks, so OSC 99's answers keep their place before a DA1 sent after them: when its row's mark turns to waiting, done or error, at each turn, as the row's waiting mark is set, the hover's line for the record its body; when a command C started ends, `Command finished`, or `Command exited with N`, so a prompt drawn again, as macOS's bash 3.2 draws one with its D at a resize, posts nothing, and bash 3.2, which sends no C, posts no command's end, as Ghostty's integration, which skips it, posts none; and when a program asks through OSC 9, 777 or 99, its title and body the body, each line shown as text. It posts only while its window is not active or it is not the session shown, which the workspace tells it, one every 3 seconds at most, a later one logged and dropped; the title is the program's title, else the app's name, as the row names the session, which the tap reads in the output's order, so a title set before a notification in the same output names it. The session's own share a tag, so a new one takes the old one's place where the system allows, as an OSC 99 id does; OSC 9, 777 and OSC 99 without an id each take their own; a session keeps its last 64. A press goes to the window whose session posted it: it shows the window and the session, unless OSC 99 said `a=-focus`, and tells a program that asked `a=report`, `OSC 99 ; i=ID ;`; a press whose record went, a twin Linux stacked and pressed before or one past the 64 kept, still shows its session and tells no program. macOS brings the app forward at any press, `a=-focus` or not, and on Wayland gpui asks for the window with a serial the compositor likely refuses, so KWin and Mutter mark it as asking for attention instead. gpui hears of no close on any system, so `c=1` hears `p=close;untracked` once posted, and alive lists the ids posted and not yet pressed, closed or expired. On macOS and Windows a close takes the notification back, and `w` over 0 takes it back once it runs out, its session gone or not, unless a later post holds its tag; gpui on Linux closes and replaces none, so there a close and `w` pass by, logged, a closed one stays alive, and an update posts beside the old one. `o` passes by: each notification posts only while unseen, which is kitty's invisible, so the query answers `a=focus,report:o=invisible:p=title,body,close,?,alive:w=1`, on Linux `a=focus,report:o=invisible:p=title,body,?,alive`, never with the `c` that close events would need. Windows' toasts are silent, as macOS's are; on Linux the notification daemon decides, and reads the body as markup, so its `&`, `<` and `>` go as entities.
|
- 2026-10-17: a session posts system notifications through gpui's, which the owner asked for. At start `set_app_identity` names the app: on Windows that sets the process's AppUserModelID, which the taskbar groups its windows by too, so a pin made before may show apart, and the first notification writes the app's name under `HKCU\Software\Classes\AppUserModelId`, as gpui needs for an app without a package; on macOS gpui posts only from the app bundle, asks for leave at the first, and logs once, under the `gpui_macos` target, that it posts nothing outside one; on Linux it posts over D-Bus through notify-rust. Each terminal view posts its own, in the order its output asks, so OSC 99's answers keep their place before a DA1 sent after them: when its row's mark turns to waiting, done or error, at each turn, as the row's waiting mark is set, the hover's line for the record its body; when a command C started ends, `Command finished`, or `Command exited with N`, so a prompt drawn again, as macOS's bash 3.2 draws one with its D at a resize, posts nothing, and bash 3.2, which sends no C, posts no command's end, as Ghostty's integration, which skips it, posts none; and when a program asks through OSC 9, 777 or 99, its title and body the body, each line shown as text. It posts only while its window is not active or it is not the session shown, which the workspace tells it, one every 3 seconds at most, a later one logged and dropped; the title is the program's title, else the app's name, as the row names the session, which the tap reads in the output's order, so a title set before a notification in the same output names it. The session's own share a tag, so a new one takes the old one's place where the system allows, as an OSC 99 id does; OSC 9, 777 and OSC 99 without an id each take their own; a session keeps its last 64. A press goes to the window whose session posted it: it shows the window and the session, unless OSC 99 said `a=-focus`, and tells a program that asked `a=report`, `OSC 99 ; i=ID ;`; a press whose record went, a twin Linux stacked and pressed before or one past the 64 kept, still shows its session and tells no program. macOS brings the app forward at any press, `a=-focus` or not, and on Wayland gpui asks for the window with a serial the compositor likely refuses, so KWin and Mutter mark it as asking for attention instead. gpui hears of no close on any system, so `c=1` hears `p=close;untracked` once posted, and alive lists the ids posted and not yet pressed, closed or expired. On macOS and Windows a close takes the notification back, and `w` over 0 takes it back once it runs out, its session gone or not, unless a later post holds its tag; gpui on Linux closes and replaces none, so there a close and `w` pass by, logged, a closed one stays alive, and an update posts beside the old one. `o` passes by: each notification posts only while unseen, which is kitty's invisible, so the query answers `a=focus,report:o=invisible:p=title,body,close,?,alive:w=1`, on Linux `a=focus,report:o=invisible:p=title,body,?,alive`, never with the `c` that close events would need. Windows' toasts are silent, as macOS's are; on Linux the notification daemon decides, and reads the body as markup, so its `&`, `<` and `>` go as entities.
|
||||||
- 2026-10-18: herdr's shortcuts, which a user found dead, as kitty and Ghostty send them. herdr 0.9.5 asks for kitty's disambiguate, events and alternates on macOS and Linux, and takes `cmd+shift+ctrl+[` as `[` with Shift, Ctrl and Super, `CSI 91;14u`, the symbol as its alternate, `CSI 91:123;14u`, as Ghostty sends it; gpui named the key `{` and cleared Shift, so ELYTerminal sent `CSI 123;13u`, which herdr matches only to `cmd+ctrl+{`. Under kitty's flags a key Shift made a symbol of now goes as its own character with Shift, the symbol its alternate; legacy keys keep fixterms' symbol without Shift, as Ghostty's do. On macOS the key's own character comes from `UCKeyTranslate` on the event's key code, in the layout gpui reads: Command's while Command is down or while the plain one types no ASCII; AppKit's `charactersByApplyingModifiers:` ignores the layout for events built in-process. On Windows herdr asks for no kitty flags and reads the console's key records, and ConPTY asks every terminal for win32-input-mode, `CSI ? 9001 h`; so, as Windows Terminal does, each key that types no text goes as `CSI Vk ; Sc ; Uc ; Kd ; Cs ; Rc _`: the virtual key from gpui's name and the layout (`VkKeyScanW`), its scan code, what Windows types for it (`ToUnicode`, a dead key left as it is), down or up, and the modifier keys, locks and enhanced block from `GetKeyState`. kitty's flags go first, as in Windows Terminal; text stays text, so a repeat or a release goes as a record where its press did, a repeat that types after its modifiers came up too, and a release goes so only there; a full reset ends the mode, as Windows Terminal's does. A key that is down is known by its code, AppKit's key code on macOS and the virtual key on Windows, since gpui names a release by the modifiers left down: a release after Shift came up still goes out. Linux has only gpui's name. A console record holds no Windows key, so no Windows terminal passes herdr a `cmd` binding, and a keypad key goes as its main key, since gpui names it so. On Linux gpui keeps neither the key code nor its xkb state, and names a non-ASCII key by its place on a US keyboard, so a key's own character cannot be found: Shift with a symbol and Ctrl, Alt or Super goes as the symbol without Shift, which herdr matches to a binding on the symbol, `ctrl+{`.
|
- 2026-10-18: herdr's shortcuts, which a user found dead, as kitty and Ghostty send them. herdr 0.9.5 asks for kitty's disambiguate, events and alternates on macOS and Linux, and takes `cmd+shift+ctrl+[` as `[` with Shift, Ctrl and Super, `CSI 91;14u`, the symbol as its alternate, `CSI 91:123;14u`, as Ghostty sends it; gpui named the key `{` and cleared Shift, so ELYTerminal sent `CSI 123;13u`, which herdr matches only to `cmd+ctrl+{`. Under kitty's flags a key Shift made a symbol of now goes as its own character with Shift, the symbol its alternate; legacy keys keep fixterms' symbol without Shift, as Ghostty's do. On macOS the key's own character comes from `UCKeyTranslate` on the event's key code, in the layout gpui reads: Command's while Command is down or while the plain one types no ASCII; AppKit's `charactersByApplyingModifiers:` ignores the layout for events built in-process. On Windows herdr asks for no kitty flags and reads the console's key records, and ConPTY asks every terminal for win32-input-mode, `CSI ? 9001 h`; so, as Windows Terminal does, each key that types no text goes as `CSI Vk ; Sc ; Uc ; Kd ; Cs ; Rc _`: the virtual key from gpui's name and the layout (`VkKeyScanW`), its scan code, what Windows types for it (`ToUnicode`, a dead key left as it is), down or up, and the modifier keys, locks and enhanced block from `GetKeyState`. kitty's flags go first, as in Windows Terminal; text stays text, so a repeat or a release goes as a record where its press did, a repeat that types after its modifiers came up too, and a release goes so only there; a full reset ends the mode, as Windows Terminal's does. A key that is down is known by its code, AppKit's key code on macOS and the virtual key on Windows, since gpui names a release by the modifiers left down: a release after Shift came up still goes out. Linux has only gpui's name. A console record holds no Windows key, so no Windows terminal passes herdr a `cmd` binding, and a keypad key goes as its main key, since gpui names it so. On Linux gpui keeps neither the key code nor its xkb state, and names a non-ASCII key by its place on a US keyboard, so a key's own character cannot be found: Shift with a symbol and Ctrl, Alt or Super goes as the symbol without Shift, which herdr matches to a binding on the symbol, `ctrl+{`.
|
||||||
- 2026-10-18: inside herdr, herdr opens its panes' links, as the owner's Cmd-press and Ctrl-press ask. herdr 0.9.5 wraps a long URL at its pane's edge with no wrap flag and writes its panes' OSC 8 links to the terminal without their targets, so ELYTerminal's own finder opened a cut URL or nothing; herdr itself opens the link under a Ctrl-press, whole from its own pane, a wrapped URL or an OSC 8 target, and underlines it while Ctrl is held. So while herdr's client leads the session and tracks the mouse, every link press goes to herdr as the mouse report it is, and on macOS herdr hears Cmd as Ctrl, the wheel aside. herdr's rules come with it, by its design: while it takes the mouse it keeps its panes' OSC 8 targets from the terminal, so that it alone answers Ctrl-press, and it opens only `http` and `https` links; a `file://` link inside herdr stays shut, since the text the terminal sees may be the label of another link. Shift with the press, which takes the mouse back from a program, is the way past herdr its docs name: the terminal then opens what it sees, a `file://` link too. With herdr's mouse capture off, herdr writes its links' targets out and the terminal opens them itself. Elsewhere ELYTerminal opens the link itself, as before.
|
- 2026-10-18: inside herdr, herdr opens its panes' links, as the owner's Cmd-press and Ctrl-press ask. herdr 0.9.5 wraps a long URL at its pane's edge with no wrap flag and writes its panes' OSC 8 links to the terminal without their targets, so ELYTerminal's own finder opened a cut URL or nothing; herdr itself opens the link under a Ctrl-press, whole from its own pane, a wrapped URL or an OSC 8 target, and underlines it while Ctrl is held. So while herdr's client leads the session and tracks the mouse, every link press goes to herdr as the mouse report it is, and on macOS herdr hears Cmd as Ctrl, the wheel aside. herdr's rules come with it, by its design: while it takes the mouse it keeps its panes' OSC 8 targets from the terminal, so that it alone answers Ctrl-press, and it opens only `http` and `https` links; a `file://` link inside herdr stays shut, since the text the terminal sees may be the label of another link. Shift with the press, which takes the mouse back from a program, is the way past herdr its docs name: the terminal then opens what it sees, a `file://` link too. With herdr's mouse capture off, herdr writes its links' targets out and the terminal opens them itself. Elsewhere ELYTerminal opens the link itself, as before.
|
||||||
- 2026-10-18: Ely peeks over the main window's top edge, which the owner asked for after the 0.1.3 film, her head and fingers drawn from the icon's own paths and cut at the edge she holds, in a transparent window of her own, 112 by 107 points with 16 above her for her hops, 140 in from the pane's left edge, less on a pane too narrow for that, so she holds its edge at any width, and the main window seems to hide the rest of her. Her window never takes the keys from the terminal: on macOS her panel becomes key only if needed, which gpui's view never asks; on Windows her window answers a press's activation with none, every other message passed on to gpui's own procedure; on X11 and Wayland a press moves no focus. gpui moves no window and places its popups only on Wayland, so each platform keeps her there its own way: on macOS gpui's popup panel is made the main window's child, at its level and in its Spaces, without a shadow, so AppKit moves it and hides it with the window; on Windows gpui's popup is owned by the main window and loses the topmost place gpui gives it, so it stays just above the main window and hides with it; gpui makes it an overlapped window, which Windows gives a caption and a frame, and opens it as large as the display when the middle of the box asked for lies off every display, as hers does over a window near the screen's top: in 0.1.4 a user found her at the bottom of a framed window the display's size, which took the clicks meant for the windows behind; so it becomes a bare popup, without caption, frame, corners or shadow, and the glue posts her window her bottom left corner on the pane's top edge as the main window moves, since Windows sends a new size at once and gpui hears it only outside its own updates, as gpui defers its own resize; her window sizes her at the DPI it has when the place lands, so her height is her own DPI's and her bottom the pane's top, whatever the two windows' DPI, and a place posted before her DPI changed sizes her at the new one; at a new DPI gpui takes the rect Windows suggests, and once the move that brought it is done she takes her box at that DPI on the corner her last place gave her, while that DPI is still hers and the box lies mostly on a display of it, as Windows reckons a window's display, else Windows' rect stands; so a keep changes no DPI and posts no other, where between two displays a corner kept always, or a keep whose DPI had passed while places piled up, set her DPI back, and back again; on X11 gpui's popup, which no window manager places, is moved onto the pane, stacked just above the window manager's frame as the window moves or comes forward, and unmapped while it hides; on Wayland she is gpui's anchored popup, an xdg_popup on the pane's top edge, which the compositor keeps there; gpui moves a popup's anchor never, so a new width that moves her place opens her again. She opens with the sessions' mood and moves all the time, as the films move her, which the owner asked for after 0.1.4, where she stood still but for a press. She is rigged from the icon's paths as the films rig her, in layers of one color, each an SVG mask gpui rasterizes once at its size and moves with a matrix of its own after its pixels are placed, so she moves between pixels; her head bobs with her breath while her neck, collar and hands stay on the edge, her side locks sway, her ahoge breathes, and she blinks on her own, at times twice. Her mood sets her act: calm, she glances left, then right, her head after her eyes, and dozes after 5 minutes, her eyes falling shut, her head and ahoge drooping, zs floating up; a program that works runs her eyes along the terminal's lines while her fingers tap by turns; one that waits on you widens her eyes, opens her mouth, rocks a mark beside her and hops her twice every 2.6 s; an error raises her brows and shakes her, more softly every 4.5 s after, while a drop runs down; a finish cheers her for 4 s with smiling eyes, a hop and sparkles; a press winks at you while a heart rises. Each act begins with her eyes opening and her mouth popping, and a change of act, a change of mood though the act stays, as inside a wink, and a press each ease her from the pose she was in, in 0.3 s, her brows with her, the marks she leaves fading. She draws at every frame the display gives her window while it shows, and gpui gives a hidden window none; her time is folded into each move's round in f64, so weeks of one mood keep her steps fine. Settings › Terminal › Ely turns her off; she is on by default.
|
- 2026-10-18: Ely peeks over the main window's top edge, which the owner asked for after the 0.1.3 film, her head and fingers drawn from the icon's own paths and cut at the edge she holds, in a transparent window of her own, 112 by 107 points with 16 above her for her hops, 140 in from the pane's left edge, less on a pane too narrow for that, so she holds its edge at any width, and the main window seems to hide the rest of her. Her window never takes the keys from the terminal: on macOS her panel becomes key only if needed, which gpui's view never asks; on Windows her window answers a press's activation with none, every other message passed on to gpui's own procedure; on X11 and Wayland a press moves no focus. gpui moves no window and places its popups only on Wayland, so each platform keeps her there its own way: on macOS gpui's popup panel is made the main window's child, at its level and in its Spaces, without a shadow, so AppKit moves it and hides it with the window; on Windows gpui's popup is owned by the main window and loses the topmost place gpui gives it, so it stays just above the main window and hides with it; gpui makes it an overlapped window, which Windows gives a caption and a frame, and opens it as large as the display when the middle of the box asked for lies off every display, as hers does over a window near the screen's top: in 0.1.4 a user found her at the bottom of a framed window the display's size, which took the clicks meant for the windows behind; so it becomes a bare popup, without caption, frame, corners or shadow, and the glue posts her window her bottom left corner on the pane's top edge as the main window moves, since Windows sends a new size at once and gpui hears it only outside its own updates, as gpui defers its own resize; her window sizes her at the DPI it has when the place lands, so her height is her own DPI's and her bottom the pane's top, whatever the two windows' DPI, and a place posted before her DPI changed sizes her at the new one; at a new DPI gpui takes the rect Windows suggests, and once the move that brought it is done she takes her box at that DPI on the corner her last place gave her, while that DPI is still hers and the box lies mostly on a display of it, as Windows reckons a window's display, else Windows' rect stands; so a keep changes no DPI and posts no other, where between two displays a corner kept always, or a keep whose DPI had passed while places piled up, set her DPI back, and back again; on X11 gpui's popup, which no window manager places, is moved onto the pane, stacked just above the window manager's frame as the window moves or comes forward, and unmapped while it hides; on Wayland she is gpui's anchored popup, an xdg_popup on the pane's top edge, which the compositor keeps there; gpui moves a popup's anchor never, so a new width that moves her place opens her again. She opens with the sessions' mood and moves all the time, as the films move her, which the owner asked for after 0.1.4, where she stood still but for a press. She is rigged from the icon's paths as the films rig her, in layers of one color, each an SVG mask gpui rasterizes once at its size and moves with a matrix of its own after its pixels are placed, so she moves between pixels; her head bobs with her breath while her neck, collar and hands stay on the edge, her side locks sway, her ahoge breathes, and she blinks on her own, at times twice. Her mood sets her act: calm, she glances left, then right, her head after her eyes, and dozes after 5 minutes, her eyes falling shut, her head and ahoge drooping, zs floating up, the 5 minutes counted from her mood's start or the last press, so a press wakes her, which the owner asked for after 0.1.4, where only a new mood did; a program that works runs her eyes along the terminal's lines while her fingers tap by turns; one that waits on you widens her eyes, opens her mouth, rocks a mark beside her and hops her twice every 2.6 s; an error raises her brows and shakes her, more softly every 4.5 s after, while a drop runs down; a finish cheers her for 4 s with smiling eyes, a hop and sparkles; a press winks at you while a heart rises. Each act begins with her eyes opening and her mouth popping, and a change of act, a change of mood though the act stays, as inside a wink, and a press each ease her from the pose she was in, in 0.3 s, her brows with her, the marks she leaves fading. She draws at every frame the display gives her window while it shows, and gpui gives a hidden window none; her time is folded into each move's round in f64, so weeks of one mood keep her steps fine. Settings › Terminal › Ely turns her off; she is on by default.
|
||||||
|
- 2026-10-19: Ely stands inside the main window, her bottom on its pane's bottom edge, as far in from the left, while her box would not fit above it, which the owner asked for after 0.1.4: on a window at the screen's top or full screen her titled macOS panel, which AppKit keeps under the menu bar, stuck between the menu bar and the terminal, and on Windows and X11 she stood off the screen. The rule lives in `pet.rs`: she stands on the top edge while the room above the pane, up to the top of the work area of the main window's display, holds her box, 123.4 points; each platform measures the room and places her: macOS from the main window's `frame` and its `screen`'s `visibleFrame`, which leaves out the menu bar, both in AppKit's points; Windows from the client rect and the work area (`rcWork`) of the monitor `MonitorFromWindow` names, at the main window's scale, since above it or inside it she stands on that monitor; X11 from the pane's place on the root, up to the top of the RandR monitor holding most of it, as Windows and macOS pick a window's display, or of `_NET_WORKAREA`, its first desktop's, where that lies lower: the work area spans every monitor, so on a lower monitor its top is another's. A Wayland client knows no place of its own, so there she stands on the bottom edge while the window is full screen, maximized or tiled at its top, which gpui reports only for a window it draws itself: under server decorations, as Sway's tiling draws them, she stays on top. gpui moves a popup's anchor never, hears a change of state alone as no change of bounds, and gives an unseen popup no frames, so twice a second she checks where the window's size and state put her anchor, counted from the pane as gpui counts it, and opens there again when it moved. Each place logs the edge she moves to. On WSLg, X11 and Weston's Wayland both put her inside a window as tall as the screen or maximized, and over one with room; headless Sway and a two-monitor Xorg did too.
|
||||||
|
- 2026-10-19: Ely's window shows nothing but her, which the owner asked for after a user's 0.1.4 drew a hairline along the top of her box on macOS. gpui opens a popup as a titled panel, style mask 0x8081, titled, full-size content and nonactivating, and macOS draws a titled window's frame, there as a light edge over the clear room above her head. As it is glued her panel turns borderless, nonactivating alone, 0x80, and the log names both masks; a mask that does not take fails the glue, which closes her window, as any failed glue now does, where her window stayed open, unplaced, while the log said she did not show. macOS 27.2 draws nothing of that frame, so the line never showed here, the app active or not; there a real click on her borderless panel still winks her, the front app stays in front, and keys typed after it reach the terminal. On Windows her bare popup, and on Linux X11's override-redirect window and Wayland's xdg_popup, draw no frame, border or shadow.
|
||||||
Generated
+1
-1
@@ -1747,7 +1747,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "elyterminal"
|
name = "elyterminal"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alacritty_terminal",
|
"alacritty_terminal",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "elyterminal"
|
name = "elyterminal"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.95"
|
rust-version = "1.95"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -41,7 +41,7 @@ raw-window-handle = "0.6"
|
|||||||
wayland-backend = { version = "0.3", features = ["client_system"] }
|
wayland-backend = { version = "0.3", features = ["client_system"] }
|
||||||
wayland-client = "0.31"
|
wayland-client = "0.31"
|
||||||
wayland-protocols = { version = "0.32", features = ["client", "staging"] }
|
wayland-protocols = { version = "0.32", features = ["client", "staging"] }
|
||||||
x11rb = "0.13"
|
x11rb = { version = "0.13", features = ["randr"] }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dev-dependencies]
|
[target.'cfg(target_os = "linux")'.dev-dependencies]
|
||||||
wayland-protocols = { version = "0.32", features = ["server", "staging"] }
|
wayland-protocols = { version = "0.32", features = ["server", "staging"] }
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Ghostty is the bar for what the terminal does. ELYTerminal owns its engine on `a
|
|||||||
- The window opens at the size it was left at, on macOS, Windows and Linux: the size is kept in settings once it settles; a maximized or full-screen window keeps the size from before; a kept size past the screen shrinks to it; the window is no smaller than 100 by 100, the least the settings keep.
|
- The window opens at the size it was left at, on macOS, Windows and Linux: the size is kept in settings once it settles; a maximized or full-screen window keeps the size from before; a kept size past the screen shrinks to it; the window is no smaller than 100 by 100, the least the settings keep.
|
||||||
- The title shows the active session's title, and no other text.
|
- The title shows the active session's title, and no other text.
|
||||||
- The pointer over the terminal is the arrow.
|
- The pointer over the terminal is the arrow.
|
||||||
- Ely, the icon's girl, peeks over the window's top edge from behind it, on macOS, Windows and Linux. She moves all the time, as she does in the films: she breathes, sways and blinks, and how the sessions are doing, waiting, an error, work, a finish or calm, moves her. A press pets her. A switch in Settings, Terminal, turns her off.
|
- Ely, the icon's girl, peeks over the window's top edge from behind it, on macOS, Windows and Linux; where no room lies above the window, at the screen's top or full screen, she stands inside it at its bottom left. She moves all the time, as she does in the films: she breathes, sways and blinks, and how the sessions are doing, waiting, an error, work, a finish or calm, moves her. Nothing but her shows: no frame, line or shadow around her. A press pets her, and wakes her from a doze. A switch in Settings, Terminal, turns her off.
|
||||||
- The title bar is transparent, as Ghostty's: the window's background, opacity and blur run under it, so it wears the terminal's color.
|
- The title bar is transparent, as Ghostty's: the window's background, opacity and blur run under it, so it wears the terminal's color.
|
||||||
- Every control in the title bar takes its own press on every platform, the window buttons Ely draws on Windows and Linux too.
|
- Every control in the title bar takes its own press on every platform, the window buttons Ely draws on Windows and Linux too.
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ The app writes its log to stderr. `RUST_LOG=elyterminal=debug` writes more; `tra
|
|||||||
|
|
||||||
- The terminal runs on `alacritty_terminal`: 256 colors and truecolor, bold, dim, italic, five underline styles, wide characters and combining marks. Box drawing, block elements and powerline shapes are drawn as geometry, so lines join across cells. Keys follow xterm and the kitty keyboard protocol, and on Windows win32-input-mode, as Windows Terminal sends them, so herdr's shortcuts work; input methods compose at the cursor; programs can track the mouse; pastes are bracketed when a program asks; OSC 8 and plain links open with the link press below; inside herdr, herdr opens them, web links only, whole where its pane wraps them, and with Shift the terminal opens what it sees; find searches the scrollback.
|
- The terminal runs on `alacritty_terminal`: 256 colors and truecolor, bold, dim, italic, five underline styles, wide characters and combining marks. Box drawing, block elements and powerline shapes are drawn as geometry, so lines join across cells. Keys follow xterm and the kitty keyboard protocol, and on Windows win32-input-mode, as Windows Terminal sends them, so herdr's shortcuts work; input methods compose at the cursor; programs can track the mouse; pastes are bracketed when a program asks; OSC 8 and plain links open with the link press below; inside herdr, herdr opens them, web links only, whole where its pane wraps them, and with Shift the terminal opens what it sees; find searches the scrollback.
|
||||||
- Shell integration for zsh, bash, fish and PowerShell: each prompt reports its folder and title, and OSC 133 marks each prompt, each command and its exit status.
|
- Shell integration for zsh, bash, fish and PowerShell: each prompt reports its folder and title, and OSC 133 marks each prompt, each command and its exit status.
|
||||||
- Ely peeks over the window's top edge and moves all the time: she breathes, sways and blinks. She follows your sessions: she hops when a program waits on you, shakes at an error, cheers a finish, reads along while a program works, and dozes when all is calm for long. Press her and she winks. Settings › Terminal › Ely turns her off.
|
- Ely peeks over the window's top edge, or up from its bottom left when the window leaves her no room above it, and moves all the time: she breathes, sways and blinks. She follows your sessions: she hops when a program waits on you, shakes at an error, cheers a finish, reads along while a program works, and dozes when all is calm for long. Press her and she winks, waking her from a doze. Settings › Terminal › Ely turns her off.
|
||||||
- Sessions: new, close and switch. A bell marks a hidden session's row and makes no sound. A row's mark shows what its programs report through OSC 7501, OSC 9;4 or herdr: waiting on you, an error, work with its progress, done or idle, else a failed last command. The mark is 3 by 3 dots: work ripples and waiting dips while they last. Hover over the mark lists each report.
|
- Sessions: new, close and switch. A bell marks a hidden session's row and makes no sound. A row's mark shows what its programs report through OSC 7501, OSC 9;4 or herdr: waiting on you, an error, work with its progress, done or idle, else a failed last command. The mark is 3 by 3 dots: work ripples and waiting dips while they last. Hover over the mark lists each report.
|
||||||
- Notifications: while the window is in the background or the session hidden, a session that starts waiting, finishes or fails, and a program's OSC 9, 777 or 99, post a system notification, one a session every 3 seconds at most; a press shows the session. On macOS only the app bundle posts them, not `cargo run`.
|
- Notifications: while the window is in the background or the session hidden, a session that starts waiting, finishes or fails, and a program's OSC 9, 777 or 99, post a system notification, one a session every 3 seconds at most; a press shows the session. On macOS only the app bundle posts them, not `cargo run`.
|
||||||
- Cmd-Up and Cmd-Down, Ctrl-Shift-Up and Ctrl-Shift-Down off macOS, jump to the prompt before or after the view's top.
|
- Cmd-Up and Cmd-Down, Ctrl-Shift-Up and Ctrl-Shift-Down off macOS, jump to the prompt before or after the view's top.
|
||||||
|
|||||||
@@ -128,4 +128,14 @@ Progress truth. Top to bottom, one at a time. A task is ticked only after its co
|
|||||||
|
|
||||||
## 27. Release
|
## 27. Release
|
||||||
|
|
||||||
- [ ] T50 v0.1.4 rebuilt with T48 and T49, which the owner asked for in place of a v0.1.5: the version stays 0.1.4; the macOS disk image, the Windows zip and the Linux tarball, each from its script, replace the old ones on the release; the tag moves to their commit; the notes give the new SHA-256 and what changed.
|
- [x] T50 v0.1.4 rebuilt with T48 and T49, which the owner asked for in place of a v0.1.5: the version stays 0.1.4; the macOS disk image, the Windows zip and the Linux tarball, each from its script, replace the old ones on the release; the tag moves to their commit; the notes give the new SHA-256 and what changed.
|
||||||
|
|
||||||
|
## 28. Ely's place, sleep and frame
|
||||||
|
|
||||||
|
- [x] T51 Ely stands inside the main window at its bottom left while no room lies above it, which the owner asked for after 0.1.4, where on a window at the screen's top or full screen she stuck between the menu bar and the terminal, on macOS, Windows and Linux: her bottom stands on the pane's top edge while her box fits under the top of the work area of the main window's display, else on the pane's bottom edge, as far in from the left; on Wayland, which tells a client nothing of its place, on the bottom edge while the window is full screen, maximized or tiled at its top as gpui reports it, which it does for a window it draws itself.
|
||||||
|
- [x] T52 A press wakes Ely from her doze, which the owner asked for: she dozes after five calm minutes since the later of her mood's start and the last press, so a press wakes her for five more.
|
||||||
|
- [x] T53 Ely's window shows nothing but her, which the owner asked for after a line showed along its top on macOS: there her window is a borderless panel, without the titled frame gpui's popup carries, whose edge macOS draws; on Windows and Linux her window shows no frame, border or shadow.
|
||||||
|
|
||||||
|
## 29. Release
|
||||||
|
|
||||||
|
- [ ] T54 Release v0.1.5 with T51 to T53: version 0.1.5; the macOS disk image, the Windows zip and the Linux tarball, each from its script; the notes list what changed.
|
||||||
+139
-143
@@ -1,20 +1,27 @@
|
|||||||
//! Ely, the icon's girl, peeking over the main window's top edge from a window of her own.
|
//! Ely, the icon's girl, peeking over the main window's top edge from a window of her own, or up from its bottom edge where no room lies above.
|
||||||
|
|
||||||
mod look;
|
mod look;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
mod macos;
|
mod macos;
|
||||||
mod rig;
|
mod rig;
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
mod windows;
|
mod windows;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
mod x11;
|
mod x11;
|
||||||
|
|
||||||
use std::{cell::RefCell, rc::Rc, time::Instant};
|
use std::{
|
||||||
|
cell::RefCell,
|
||||||
|
rc::Rc,
|
||||||
|
time::{Duration, Instant},
|
||||||
|
};
|
||||||
|
|
||||||
use gpui::{
|
use gpui::{
|
||||||
App, AppContext as _, Bounds, Context, InteractiveElement, IntoElement, MouseButton,
|
App, AppContext as _, Bounds, Context, Decorations, InteractiveElement, IntoElement,
|
||||||
ParentElement, Pixels, Render, Styled, Subscription, Window, WindowBackgroundAppearance,
|
MouseButton, ParentElement, Pixels, Point, Render, Styled, Subscription, Window,
|
||||||
WindowBounds, WindowHandle, WindowKind, WindowOptions, canvas, div, point, popup, px, size,
|
WindowBackgroundAppearance, WindowBounds, WindowHandle, WindowKind, WindowOptions, canvas, div,
|
||||||
|
point, popup, px, size,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
@@ -35,6 +42,18 @@ const HEAD: f32 = 107.4;
|
|||||||
const ROOM: f32 = 16.0;
|
const ROOM: f32 = 16.0;
|
||||||
/// How far in from the pane's left edge she holds its top edge.
|
/// How far in from the pane's left edge she holds its top edge.
|
||||||
const LEFT: f32 = 140.0;
|
const LEFT: f32 = 140.0;
|
||||||
|
/// How often she checks her Wayland anchor against the main window.
|
||||||
|
const CHECK: Duration = Duration::from_millis(500);
|
||||||
|
|
||||||
|
/// The pane edge her bottom stands on: the top, or the bottom, inside the window.
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
|
enum Edge {
|
||||||
|
Top,
|
||||||
|
Bottom,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The window she shows in, which the settings open and close.
|
||||||
|
type Shown = Rc<RefCell<Option<WindowHandle<Pet>>>>;
|
||||||
|
|
||||||
/// Ely in her window: she moves all the time, her acts follow the sessions' marks, and a press pets her.
|
/// Ely in her window: she moves all the time, her acts follow the sessions' marks, and a press pets her.
|
||||||
pub struct Pet {
|
pub struct Pet {
|
||||||
@@ -48,8 +67,9 @@ pub struct Pet {
|
|||||||
act: Act,
|
act: Act,
|
||||||
last: Option<Pose>,
|
last: Option<Pose>,
|
||||||
eased: Option<(Pose, Instant)>,
|
eased: Option<(Pose, Instant)>,
|
||||||
/// How far in from the pane's left edge she opened.
|
/// The edge she stands on, and on Wayland the anchor her popup opened at, from the pane's top left, which never moves.
|
||||||
left: f32,
|
edge: Edge,
|
||||||
|
anchor: Option<Point<Pixels>>,
|
||||||
/// What keeps her window on the main window's edge, where the platform does not.
|
/// What keeps her window on the main window's edge, where the platform does not.
|
||||||
glue: Option<platform::Glue>,
|
glue: Option<platform::Glue>,
|
||||||
_watch: Vec<Subscription>,
|
_watch: Vec<Subscription>,
|
||||||
@@ -57,7 +77,7 @@ pub struct Pet {
|
|||||||
|
|
||||||
/// Shows Ely over `main` while the settings want her.
|
/// Shows Ely over `main` while the settings want her.
|
||||||
pub fn follow(main: WindowHandle<Workspace>, cx: &mut App) {
|
pub fn follow(main: WindowHandle<Workspace>, cx: &mut App) {
|
||||||
let shown: Rc<RefCell<Option<WindowHandle<Pet>>>> = Rc::default();
|
let shown: Shown = Rc::default();
|
||||||
let sync = {
|
let sync = {
|
||||||
let shown = shown.clone();
|
let shown = shown.clone();
|
||||||
move |cx: &mut App| {
|
move |cx: &mut App| {
|
||||||
@@ -74,25 +94,17 @@ pub fn follow(main: WindowHandle<Workspace>, cx: &mut App) {
|
|||||||
};
|
};
|
||||||
sync(cx);
|
sync(cx);
|
||||||
cx.observe_global::<SettingsStore>(sync).detach();
|
cx.observe_global::<SettingsStore>(sync).detach();
|
||||||
// A Wayland popup keeps the place it opened at, so she opens again where a new width puts her.
|
// gpui hears a change of state alone as no change of bounds, and sends an unseen popup no frames.
|
||||||
let moved = main.update(cx, |_, window, cx| {
|
if main
|
||||||
cx.observe_window_bounds(window, move |_, window, cx| {
|
.update(cx, |_, window, _| wayland(window))
|
||||||
let Some(pet) = *shown.borrow() else {
|
.is_ok_and(|wayland| wayland)
|
||||||
return;
|
{
|
||||||
};
|
cx.spawn(async move |cx| {
|
||||||
let at = left(pane(window).size.width);
|
while cx.update(|cx| reanchor(main, &shown, cx)).is_ok() {
|
||||||
if wayland(window) && pet.read(cx).is_ok_and(|pet| pet.left != at) {
|
cx.background_executor().timer(CHECK).await;
|
||||||
let shown = shown.clone();
|
|
||||||
cx.defer(move |cx| {
|
|
||||||
close(pet, "to stand where the new width puts her", cx);
|
|
||||||
*shown.borrow_mut() = open_pet(main, cx);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
.detach();
|
||||||
match moved {
|
|
||||||
Ok(moved) => moved.detach(),
|
|
||||||
Err(error) => log::error!("pet: the main window's width goes unwatched: {error:#}"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,28 +130,86 @@ fn left(width: Pixels) -> f32 {
|
|||||||
LEFT.min(f32::from(width) - WIDTH).max(0.0)
|
LEFT.min(f32::from(width) - WIDTH).max(0.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Opens her window on `main`'s top edge: a popup Wayland's compositor places, else a window kept there.
|
/// The edge she stands on with `room` points free above the pane, up to the top of the work area of the main window's display.
|
||||||
|
fn edge(room: f32) -> Edge {
|
||||||
|
if room >= HEAD + ROOM {
|
||||||
|
Edge::Top
|
||||||
|
} else {
|
||||||
|
Edge::Bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The edge she stands on over a Wayland window, whose place no client knows: the bottom while it is full screen, maximized or tiled at its top.
|
||||||
|
fn wayland_edge(window: &Window) -> Edge {
|
||||||
|
let tiled = matches!(window.window_decorations(), Decorations::Client { tiling } if tiling.top);
|
||||||
|
if tiled || window.is_fullscreen() || window.is_maximized() {
|
||||||
|
Edge::Bottom
|
||||||
|
} else {
|
||||||
|
Edge::Top
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Where she stands over a Wayland window: the edge, and her anchor counted from the pane's top left, as gpui's popups count.
|
||||||
|
fn wayland_spot(window: &Window) -> (Edge, Point<Pixels>) {
|
||||||
|
let pane = pane(window);
|
||||||
|
let edge = wayland_edge(window);
|
||||||
|
let y = match edge {
|
||||||
|
Edge::Top => px(0.),
|
||||||
|
Edge::Bottom => pane.size.height - px(1.),
|
||||||
|
};
|
||||||
|
(edge, point(px(left(pane.size.width)), y))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Opens her again over a Wayland `main` once its size or state moves the anchor her popup opened at, which never moves.
|
||||||
|
fn reanchor(main: WindowHandle<Workspace>, shown: &Shown, cx: &mut App) -> anyhow::Result<()> {
|
||||||
|
let spot = main.update(cx, |_, window, _| wayland_spot(window))?;
|
||||||
|
let Some(pet) = *shown.borrow() else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
if pet
|
||||||
|
.read(cx)
|
||||||
|
.is_ok_and(|pet| (pet.edge, pet.anchor) == (spot.0, Some(spot.1)))
|
||||||
|
{
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
close(
|
||||||
|
pet,
|
||||||
|
"to stand where the window's new size or state puts her",
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
*shown.borrow_mut() = open_pet(main, cx);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Opens her window on `main`'s pane: a popup Wayland's compositor places, else a window kept there.
|
||||||
fn show(main: WindowHandle<Workspace>, cx: &mut App) -> anyhow::Result<WindowHandle<Pet>> {
|
fn show(main: WindowHandle<Workspace>, cx: &mut App) -> anyhow::Result<WindowHandle<Pet>> {
|
||||||
let (bounds, pane, wayland) = main.update(cx, |_, window, _| {
|
let (bounds, pane, wayland, (edge, spot)) = main.update(cx, |_, window, _| {
|
||||||
(window.bounds(), pane(window), wayland(window))
|
(
|
||||||
|
window.bounds(),
|
||||||
|
pane(window),
|
||||||
|
wayland(window),
|
||||||
|
wayland_spot(window),
|
||||||
|
)
|
||||||
})?;
|
})?;
|
||||||
let at = left(pane.size.width);
|
let at = left(pane.size.width);
|
||||||
let room = size(px(WIDTH), px(HEAD + ROOM));
|
let room = size(px(WIDTH), px(HEAD + ROOM));
|
||||||
let kind = if wayland {
|
let (edge, kind) = if wayland {
|
||||||
WindowKind::AnchoredPopup(popup::PopupOptions {
|
let anchor = match edge {
|
||||||
|
Edge::Top => popup::PopupAnchor::TopLeft,
|
||||||
|
Edge::Bottom => popup::PopupAnchor::BottomLeft,
|
||||||
|
};
|
||||||
|
let kind = WindowKind::AnchoredPopup(popup::PopupOptions {
|
||||||
parent: main.into(),
|
parent: main.into(),
|
||||||
anchor_rect: Bounds::new(
|
anchor_rect: Bounds::new(pane.origin + spot, size(px(1.), px(1.))),
|
||||||
point(pane.origin.x + px(at), pane.origin.y),
|
anchor,
|
||||||
size(px(1.), px(1.)),
|
|
||||||
),
|
|
||||||
anchor: popup::PopupAnchor::TopLeft,
|
|
||||||
gravity: popup::PopupGravity::TopRight,
|
gravity: popup::PopupGravity::TopRight,
|
||||||
constraint_adjustment: popup::PopupConstraintAdjustment::empty(),
|
constraint_adjustment: popup::PopupConstraintAdjustment::empty(),
|
||||||
offset: point(px(0.), px(0.)),
|
offset: point(px(0.), px(0.)),
|
||||||
grab: false,
|
grab: false,
|
||||||
})
|
});
|
||||||
|
(edge, kind)
|
||||||
} else {
|
} else {
|
||||||
WindowKind::PopUp
|
(Edge::Top, WindowKind::PopUp)
|
||||||
};
|
};
|
||||||
let origin = bounds.origin + pane.origin + point(px(at), -room.height);
|
let origin = bounds.origin + pane.origin + point(px(at), -room.height);
|
||||||
let options = WindowOptions {
|
let options = WindowOptions {
|
||||||
@@ -182,30 +252,37 @@ fn show(main: WindowHandle<Workspace>, cx: &mut App) -> anyhow::Result<WindowHan
|
|||||||
act: Act::Calm,
|
act: Act::Calm,
|
||||||
last: None,
|
last: None,
|
||||||
eased: None,
|
eased: None,
|
||||||
left: at,
|
edge,
|
||||||
|
anchor: wayland.then_some(spot),
|
||||||
glue: None,
|
glue: None,
|
||||||
_watch: vec![feel],
|
_watch: vec![feel],
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})?;
|
})?;
|
||||||
if !wayland {
|
let (way, edge) = if wayland {
|
||||||
glue(main, pet, cx)?;
|
("a Wayland popup", edge)
|
||||||
}
|
|
||||||
let way = if wayland {
|
|
||||||
"a Wayland popup"
|
|
||||||
} else {
|
} else {
|
||||||
"a window kept there"
|
let glued = glue(main, pet, cx);
|
||||||
|
let edge = glued.inspect_err(|_| close(pet, "as her window cannot be kept there", cx))?;
|
||||||
|
("a window kept there", edge)
|
||||||
};
|
};
|
||||||
log::info!("pet: Ely peeks over the main window, {way}, feeling {start:?}");
|
let edge = format!("{edge:?}").to_lowercase();
|
||||||
|
log::info!(
|
||||||
|
"pet: Ely peeks over the main window, {way}, on the pane's {edge} edge, feeling {start:?}"
|
||||||
|
);
|
||||||
Ok(pet)
|
Ok(pet)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Keeps her window on `main`'s top edge as it moves, comes forward and hides.
|
/// Keeps her window on `main`'s pane as it moves, comes forward and hides, and gives the edge she first stands on.
|
||||||
fn glue(main: WindowHandle<Workspace>, pet: WindowHandle<Pet>, cx: &mut App) -> anyhow::Result<()> {
|
fn glue(
|
||||||
|
main: WindowHandle<Workspace>,
|
||||||
|
pet: WindowHandle<Pet>,
|
||||||
|
cx: &mut App,
|
||||||
|
) -> anyhow::Result<Edge> {
|
||||||
main.update(cx, |_, main, cx| {
|
main.update(cx, |_, main, cx| {
|
||||||
pet.update(cx, |pet, window, cx| {
|
pet.update(cx, |pet, window, cx| {
|
||||||
let glue = platform::Glue::new(window, main)?;
|
let glue = platform::Glue::new(window, main)?;
|
||||||
glue.place(main)?;
|
pet.edge = glue.place(main)?;
|
||||||
pet.glue = Some(glue);
|
pet.glue = Some(glue);
|
||||||
pet._watch
|
pet._watch
|
||||||
.push(cx.observe_window_bounds(main, |pet, main, _| pet.place(main)));
|
.push(cx.observe_window_bounds(main, |pet, main, _| pet.place(main)));
|
||||||
@@ -217,7 +294,7 @@ fn glue(main: WindowHandle<Workspace>, pet: WindowHandle<Pet>, cx: &mut App) ->
|
|||||||
pet.shown(visibility.is_visible(), main)
|
pet.shown(visibility.is_visible(), main)
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
anyhow::Ok(())
|
anyhow::Ok(pet.edge)
|
||||||
})?
|
})?
|
||||||
})?
|
})?
|
||||||
}
|
}
|
||||||
@@ -290,16 +367,23 @@ impl Pet {
|
|||||||
pose
|
pose
|
||||||
}
|
}
|
||||||
|
|
||||||
fn place(&self, main: &Window) {
|
fn place(&mut self, main: &Window) {
|
||||||
if let Some(glue) = &self.glue
|
let Some(glue) = &self.glue else {
|
||||||
&& let Err(error) = glue.place(main)
|
return;
|
||||||
{
|
};
|
||||||
log::error!("{error:#}");
|
match glue.place(main) {
|
||||||
|
Ok(edge) if edge != self.edge => {
|
||||||
|
let name = format!("{edge:?}").to_lowercase();
|
||||||
|
log::info!("pet: Ely moves to the pane's {name} edge");
|
||||||
|
self.edge = edge;
|
||||||
|
}
|
||||||
|
Ok(_) => {}
|
||||||
|
Err(error) => log::error!("{error:#}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn shown(&self, visible: bool, main: &Window) {
|
fn shown(&mut self, visible: bool, main: &Window) {
|
||||||
if let Some(glue) = &self.glue {
|
if let Some(glue) = &self.glue {
|
||||||
match glue.shown(visible) {
|
match glue.shown(visible) {
|
||||||
Ok(()) => log::debug!("pet: Ely shows {visible} with the main window"),
|
Ok(()) => log::debug!("pet: Ely shows {visible} with the main window"),
|
||||||
@@ -334,91 +418,3 @@ impl Render for Pet {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
use super::{look::Mark, *};
|
|
||||||
|
|
||||||
/// Her, `mood` since `since`, come long before.
|
|
||||||
fn ely(mood: Mood, since: Instant) -> Pet {
|
|
||||||
Pet {
|
|
||||||
rig: Rc::new(Rig::new()),
|
|
||||||
mood,
|
|
||||||
since,
|
|
||||||
shown: since - Duration::from_secs(60),
|
|
||||||
petted: None,
|
|
||||||
act: Act::Calm,
|
|
||||||
last: None,
|
|
||||||
eased: None,
|
|
||||||
left: LEFT,
|
|
||||||
glue: None,
|
|
||||||
_watch: Vec::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn a_change_of_mood_or_a_press_eases_her_from_where_she_is_though_the_act_stays() {
|
|
||||||
let start = Instant::now();
|
|
||||||
let at = |ms: u64| start + Duration::from_millis(ms);
|
|
||||||
// A wait hops her, a press winks, and a program starts working inside the wink.
|
|
||||||
let mut pet = ely(Mood::Waiting, start);
|
|
||||||
pet.press(at(2250));
|
|
||||||
let before = pet.pose(at(2750));
|
|
||||||
pet.feel(Mood::Working, at(2750));
|
|
||||||
let after = pet.pose(at(2751));
|
|
||||||
assert_eq!((before.act, after.act), (Act::Wink, Act::Wink));
|
|
||||||
assert!(
|
|
||||||
(after.lift - before.lift).abs() < 1.0,
|
|
||||||
"no drop: {} then {}",
|
|
||||||
before.lift,
|
|
||||||
after.lift
|
|
||||||
);
|
|
||||||
let marks: Vec<Mark> = after.marks.iter().map(|(mark, _)| *mark).collect();
|
|
||||||
assert!(
|
|
||||||
marks.contains(&Mark::Bang),
|
|
||||||
"the wait's mark fades: {marks:?}"
|
|
||||||
);
|
|
||||||
// An old finish clears mid-glance: calm before and after, her eyes turn back at her pace.
|
|
||||||
let mut pet = ely(Mood::Done, start);
|
|
||||||
let before = pet.pose(at(13_600));
|
|
||||||
pet.feel(Mood::Calm, at(13_600));
|
|
||||||
let after = pet.pose(at(13_601));
|
|
||||||
assert_eq!((before.act, after.act), (Act::Calm, Act::Calm));
|
|
||||||
assert!(
|
|
||||||
before.look.0 < -5.0 && (after.look.0 - before.look.0).abs() < 0.5,
|
|
||||||
"no snap: {:?} then {:?}",
|
|
||||||
before.look,
|
|
||||||
after.look
|
|
||||||
);
|
|
||||||
let later = pet.pose(at(14_000));
|
|
||||||
assert!(
|
|
||||||
pet.eased.is_none() && later.look.0.abs() < 0.5,
|
|
||||||
"eased in by then"
|
|
||||||
);
|
|
||||||
// A second press mid-hop restarts the wink without a drop.
|
|
||||||
let mut pet = ely(Mood::Calm, start);
|
|
||||||
pet.press(at(1000));
|
|
||||||
let before = pet.pose(at(1300));
|
|
||||||
pet.press(at(1300));
|
|
||||||
let after = pet.pose(at(1301));
|
|
||||||
assert!(
|
|
||||||
before.lift > 10.0 && (after.lift - before.lift).abs() < 1.0,
|
|
||||||
"no drop: {} then {}",
|
|
||||||
before.lift,
|
|
||||||
after.lift
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn she_holds_the_edge_of_any_pane() {
|
|
||||||
assert_eq!(left(px(1200.)), LEFT);
|
|
||||||
assert_eq!(left(px(200.)), 200.0 - WIDTH);
|
|
||||||
assert_eq!(
|
|
||||||
left(px(100.)),
|
|
||||||
0.0,
|
|
||||||
"narrower than she is, she stands at its left"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+4
-3
@@ -37,7 +37,7 @@ pub fn mood(looks: impl IntoIterator<Item = Look>) -> Mood {
|
|||||||
.unwrap_or(Mood::Calm)
|
.unwrap_or(Mood::Calm)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Seconds she cheers a program that finished, and calm lasts before she dozes.
|
/// Seconds she cheers a program that finished, and calm lasts, from her mood's start or the last press, before she dozes.
|
||||||
const CHEER: f64 = 4.0;
|
const CHEER: f64 = 4.0;
|
||||||
const DOZE: f64 = 300.0;
|
const DOZE: f64 = 300.0;
|
||||||
/// Seconds a press keeps her wink.
|
/// Seconds a press keeps her wink.
|
||||||
@@ -127,14 +127,15 @@ pub struct Pose {
|
|||||||
pub marks: Vec<(Mark, Motion)>,
|
pub marks: Vec<(Mark, Motion)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Her pose `held` seconds into `mood`, `shown` seconds after she came, and `petted` seconds after a press.
|
/// Her pose `held` seconds into `mood`, `shown` seconds after she came, and `petted` seconds after a press, which wakes her from a doze for `DOZE` more.
|
||||||
pub fn pose(mood: Mood, held: f64, shown: f64, petted: Option<f64>) -> Pose {
|
pub fn pose(mood: Mood, held: f64, shown: f64, petted: Option<f64>) -> Pose {
|
||||||
|
let stirred = petted.map_or(held, |since| held.min(since));
|
||||||
let mut pose = match mood {
|
let mut pose = match mood {
|
||||||
Mood::Waiting => waiting(held),
|
Mood::Waiting => waiting(held),
|
||||||
Mood::Error => fretting(held),
|
Mood::Error => fretting(held),
|
||||||
Mood::Working => working(held),
|
Mood::Working => working(held),
|
||||||
Mood::Done if held < CHEER => cheering(held),
|
Mood::Done if held < CHEER => cheering(held),
|
||||||
Mood::Calm | Mood::Done if held >= DOZE => dozing(held - DOZE),
|
Mood::Calm | Mood::Done if stirred >= DOZE => dozing(stirred - DOZE),
|
||||||
Mood::Calm => calm(held),
|
Mood::Calm => calm(held),
|
||||||
Mood::Done => calm(held - CHEER),
|
Mood::Done => calm(held - CHEER),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -169,6 +169,23 @@ fn a_press_winks_with_a_heart_that_rises() {
|
|||||||
assert!(asleep.open[1] > 0.9, "a press wakes her other eye");
|
assert!(asleep.open[1] > 0.9, "a press wakes her other eye");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn a_press_wakes_her_from_her_doze_for_five_minutes_more() {
|
||||||
|
assert_eq!(at(Mood::Calm, 400.0).act, Act::Doze, "asleep, unpressed");
|
||||||
|
let pressed = |since: f64| pose(Mood::Calm, 400.0 + since, 410.0 + since, Some(since));
|
||||||
|
assert_eq!(pressed(0.5).act, Act::Wink);
|
||||||
|
assert_eq!(
|
||||||
|
(pressed(2.0).act, pressed(2.0).eyes),
|
||||||
|
(Act::Calm, Eyes::Open),
|
||||||
|
"awake after the wink"
|
||||||
|
);
|
||||||
|
assert_eq!(pressed(299.0).act, Act::Calm, "awake five minutes");
|
||||||
|
assert_eq!(pressed(301.0).act, Act::Doze, "then asleep again");
|
||||||
|
assert!(pressed(300.3).open[0] < 1.0, "her eyes fall shut again");
|
||||||
|
let finished = pose(Mood::Done, 400.0, 410.0, Some(2.0));
|
||||||
|
assert_eq!(finished.act, Act::Calm, "a finish long past wakes alike");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn she_rises_from_behind_the_edge_when_she_comes() {
|
fn she_rises_from_behind_the_edge_when_she_comes() {
|
||||||
assert!(pose(Mood::Calm, 0.0, 0.0, None).lift <= -DEPTH);
|
assert!(pose(Mood::Calm, 0.0, 0.0, None).lift <= -DEPTH);
|
||||||
|
|||||||
+28
-7
@@ -1,4 +1,4 @@
|
|||||||
//! Ely's window on macOS: a child of the main window at its level, so it moves with it and keeps its layer and Space.
|
//! Ely's window on macOS: a borderless panel, the main window's child at its level, so it moves with it and keeps its layer and Space.
|
||||||
|
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use gpui::Window;
|
use gpui::Window;
|
||||||
@@ -9,10 +9,12 @@ use objc::{
|
|||||||
};
|
};
|
||||||
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
||||||
|
|
||||||
use super::left;
|
use super::{Edge, edge, left};
|
||||||
|
|
||||||
/// AppKit's `NSWindowAbove`.
|
/// AppKit's `NSWindowAbove`.
|
||||||
const ABOVE: isize = 1;
|
const ABOVE: isize = 1;
|
||||||
|
/// AppKit's `NSWindowStyleMaskNonactivatingPanel` alone: a panel without the titled frame gpui's popup carries.
|
||||||
|
const BORDERLESS_PANEL: usize = 1 << 7;
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
@@ -36,10 +38,21 @@ pub struct Glue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Glue {
|
impl Glue {
|
||||||
/// Makes her window the main window's child, at its level and in its Spaces, with no shadow and never key, so a press leaves the keys with the terminal.
|
/// Makes her window a borderless panel, the main window's child, at its level and in its Spaces, with no shadow and never key, so a press leaves the keys with the terminal.
|
||||||
pub fn new(pet: &Window, main: &Window) -> anyhow::Result<Self> {
|
pub fn new(pet: &Window, main: &Window) -> anyhow::Result<Self> {
|
||||||
let (pet, main) = (native(pet)?, native(main)?);
|
let (pet, main) = (native(pet)?, native(main)?);
|
||||||
unsafe {
|
unsafe {
|
||||||
|
// A titled window gets a frame macOS draws and keeps under the menu bar.
|
||||||
|
let titled: usize = msg_send![pet, styleMask];
|
||||||
|
let _: () = msg_send![pet, setStyleMask: BORDERLESS_PANEL];
|
||||||
|
let mask: usize = msg_send![pet, styleMask];
|
||||||
|
anyhow::ensure!(
|
||||||
|
mask == BORDERLESS_PANEL,
|
||||||
|
"pet: her panel keeps style mask {mask:#x}"
|
||||||
|
);
|
||||||
|
log::info!(
|
||||||
|
"pet: her panel drops its titled frame, style mask {titled:#x} to {mask:#x}"
|
||||||
|
);
|
||||||
let level: isize = msg_send![main, level];
|
let level: isize = msg_send![main, level];
|
||||||
let _: () = msg_send![pet, setLevel: level];
|
let _: () = msg_send![pet, setLevel: level];
|
||||||
let spaces: usize = msg_send![main, collectionBehavior];
|
let spaces: usize = msg_send![main, collectionBehavior];
|
||||||
@@ -51,17 +64,25 @@ impl Glue {
|
|||||||
Ok(Self { pet, main })
|
Ok(Self { pet, main })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stands her on the main window's top edge, as far in as its width allows.
|
/// Stands her on the main window's top edge while her box fits under the top of its screen's visible frame, else on its bottom edge, as far in as its width allows, and gives the edge.
|
||||||
pub fn place(&self, _: &Window) -> anyhow::Result<()> {
|
pub fn place(&self, _: &Window) -> anyhow::Result<Edge> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let frame: Rect = msg_send![self.main, frame];
|
let frame: Rect = msg_send![self.main, frame];
|
||||||
|
let screen: *mut Object = msg_send![self.main, screen];
|
||||||
|
anyhow::ensure!(!screen.is_null(), "pet: the main window is on no screen");
|
||||||
|
let visible: Rect = msg_send![screen, visibleFrame];
|
||||||
|
let top = frame.origin.y + frame.height;
|
||||||
|
let edge = edge((visible.origin.y + visible.height - top) as f32);
|
||||||
let at = Point {
|
let at = Point {
|
||||||
x: frame.origin.x + f64::from(left(gpui::px(frame.width as f32))),
|
x: frame.origin.x + f64::from(left(gpui::px(frame.width as f32))),
|
||||||
y: frame.origin.y + frame.height,
|
y: match edge {
|
||||||
|
Edge::Top => top,
|
||||||
|
Edge::Bottom => frame.origin.y,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
let _: () = msg_send![self.pet, setFrameOrigin: at];
|
let _: () = msg_send![self.pet, setFrameOrigin: at];
|
||||||
|
Ok(edge)
|
||||||
}
|
}
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
|
use super::{look::Mark, *};
|
||||||
|
|
||||||
|
/// Her, `mood` since `since`, come long before.
|
||||||
|
fn ely(mood: Mood, since: Instant) -> Pet {
|
||||||
|
Pet {
|
||||||
|
rig: Rc::new(Rig::new()),
|
||||||
|
mood,
|
||||||
|
since,
|
||||||
|
shown: since - Duration::from_secs(60),
|
||||||
|
petted: None,
|
||||||
|
act: Act::Calm,
|
||||||
|
last: None,
|
||||||
|
eased: None,
|
||||||
|
edge: Edge::Top,
|
||||||
|
anchor: None,
|
||||||
|
glue: None,
|
||||||
|
_watch: Vec::new(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn a_change_of_mood_or_a_press_eases_her_from_where_she_is_though_the_act_stays() {
|
||||||
|
let start = Instant::now();
|
||||||
|
let at = |ms: u64| start + Duration::from_millis(ms);
|
||||||
|
// A wait hops her, a press winks, and a program starts working inside the wink.
|
||||||
|
let mut pet = ely(Mood::Waiting, start);
|
||||||
|
pet.press(at(2250));
|
||||||
|
let before = pet.pose(at(2750));
|
||||||
|
pet.feel(Mood::Working, at(2750));
|
||||||
|
let after = pet.pose(at(2751));
|
||||||
|
assert_eq!((before.act, after.act), (Act::Wink, Act::Wink));
|
||||||
|
assert!(
|
||||||
|
(after.lift - before.lift).abs() < 1.0,
|
||||||
|
"no drop: {} then {}",
|
||||||
|
before.lift,
|
||||||
|
after.lift
|
||||||
|
);
|
||||||
|
let marks: Vec<Mark> = after.marks.iter().map(|(mark, _)| *mark).collect();
|
||||||
|
assert!(
|
||||||
|
marks.contains(&Mark::Bang),
|
||||||
|
"the wait's mark fades: {marks:?}"
|
||||||
|
);
|
||||||
|
// An old finish clears mid-glance: calm before and after, her eyes turn back at her pace.
|
||||||
|
let mut pet = ely(Mood::Done, start);
|
||||||
|
let before = pet.pose(at(13_600));
|
||||||
|
pet.feel(Mood::Calm, at(13_600));
|
||||||
|
let after = pet.pose(at(13_601));
|
||||||
|
assert_eq!((before.act, after.act), (Act::Calm, Act::Calm));
|
||||||
|
assert!(
|
||||||
|
before.look.0 < -5.0 && (after.look.0 - before.look.0).abs() < 0.5,
|
||||||
|
"no snap: {:?} then {:?}",
|
||||||
|
before.look,
|
||||||
|
after.look
|
||||||
|
);
|
||||||
|
let later = pet.pose(at(14_000));
|
||||||
|
assert!(
|
||||||
|
pet.eased.is_none() && later.look.0.abs() < 0.5,
|
||||||
|
"eased in by then"
|
||||||
|
);
|
||||||
|
// A second press mid-hop restarts the wink without a drop.
|
||||||
|
let mut pet = ely(Mood::Calm, start);
|
||||||
|
pet.press(at(1000));
|
||||||
|
let before = pet.pose(at(1300));
|
||||||
|
pet.press(at(1300));
|
||||||
|
let after = pet.pose(at(1301));
|
||||||
|
assert!(
|
||||||
|
before.lift > 10.0 && (after.lift - before.lift).abs() < 1.0,
|
||||||
|
"no drop: {} then {}",
|
||||||
|
before.lift,
|
||||||
|
after.lift
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn a_press_on_her_while_she_dozes_wakes_her() {
|
||||||
|
let start = Instant::now();
|
||||||
|
let at = |secs: u64| start + Duration::from_secs(secs);
|
||||||
|
let mut pet = ely(Mood::Calm, start);
|
||||||
|
assert_eq!(pet.pose(at(400)).act, Act::Doze);
|
||||||
|
pet.press(at(400));
|
||||||
|
assert_eq!(pet.pose(at(402)).act, Act::Calm, "awake");
|
||||||
|
assert_eq!(
|
||||||
|
pet.pose(at(701)).act,
|
||||||
|
Act::Doze,
|
||||||
|
"five calm minutes on, asleep again"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn she_stands_on_the_top_edge_while_her_box_fits_above_it() {
|
||||||
|
assert_eq!(edge(HEAD + ROOM), Edge::Top, "just room for her");
|
||||||
|
assert_eq!(edge(400.0), Edge::Top);
|
||||||
|
assert_eq!(edge(HEAD + ROOM - 0.5), Edge::Bottom, "half a point short");
|
||||||
|
assert_eq!(edge(0.0), Edge::Bottom, "a window at the work area's top");
|
||||||
|
assert_eq!(edge(-30.0), Edge::Bottom, "a window above it");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn she_holds_the_edge_of_any_pane() {
|
||||||
|
assert_eq!(left(px(1200.)), LEFT);
|
||||||
|
assert_eq!(left(px(200.)), 200.0 - WIDTH);
|
||||||
|
assert_eq!(
|
||||||
|
left(px(100.)),
|
||||||
|
0.0,
|
||||||
|
"narrower than she is, she stands at its left"
|
||||||
|
);
|
||||||
|
}
|
||||||
+30
-15
@@ -1,4 +1,4 @@
|
|||||||
//! Ely's window on Windows: a bare popup owned by the main window, so it stays above it and hides with it, sized and moved as it moves.
|
//! Ely's window on Windows: a bare popup owned by the main window, so it stays above it and hides with it, sized and moved onto an edge of its pane as it moves.
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
cell::Cell,
|
cell::Cell,
|
||||||
@@ -10,7 +10,9 @@ use gpui::{Bounds, Pixels, Window};
|
|||||||
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
||||||
use windows_sys::Win32::{
|
use windows_sys::Win32::{
|
||||||
Foundation::{HWND, LPARAM, LRESULT, RECT, WPARAM},
|
Foundation::{HWND, LPARAM, LRESULT, RECT, WPARAM},
|
||||||
Graphics::Gdi::{MONITOR_DEFAULTTONEAREST, MonitorFromRect},
|
Graphics::Gdi::{
|
||||||
|
GetMonitorInfoW, MONITOR_DEFAULTTONEAREST, MONITORINFO, MonitorFromRect, MonitorFromWindow,
|
||||||
|
},
|
||||||
UI::{
|
UI::{
|
||||||
HiDpi::{GetDpiForMonitor, GetDpiForWindow, MDT_EFFECTIVE_DPI},
|
HiDpi::{GetDpiForMonitor, GetDpiForWindow, MDT_EFFECTIVE_DPI},
|
||||||
WindowsAndMessaging::{
|
WindowsAndMessaging::{
|
||||||
@@ -23,7 +25,7 @@ use windows_sys::Win32::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{HEAD, ROOM, WIDTH, left, pane};
|
use super::{Edge, HEAD, ROOM, WIDTH, edge, left, pane};
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
@@ -75,33 +77,46 @@ impl Glue {
|
|||||||
Ok(Self { pet, main })
|
Ok(Self { pet, main })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stands her on the main window's top edge, as far in as its width allows.
|
/// Stands her on the main window's top edge while her box fits under the top of its display's work area, else on its bottom edge, as far in as its width allows, and gives the edge.
|
||||||
pub fn place(&self, main: &Window) -> anyhow::Result<()> {
|
pub fn place(&self, main: &Window) -> anyhow::Result<Edge> {
|
||||||
self.put(main.scale_factor(), pane(main))
|
self.put(main.scale_factor(), pane(main))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Posts her bottom left corner on `pane` at `scale`, in the main window's points; her window sizes her at the DPI it has when the place lands, as gpui did not when it opened her off the display.
|
/// Posts her bottom left corner on an edge of `pane` at `scale`, in the main window's points; her window sizes her at the DPI it has when the place lands, as gpui did not when it opened her off the display.
|
||||||
fn put(&self, scale: f32, pane: Bounds<Pixels>) -> anyhow::Result<()> {
|
fn put(&self, scale: f32, pane: Bounds<Pixels>) -> anyhow::Result<Edge> {
|
||||||
let mut main = WINDOWINFO {
|
let mut main = WINDOWINFO {
|
||||||
cbSize: size_of::<WINDOWINFO>() as u32,
|
cbSize: size_of::<WINDOWINFO>() as u32,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let read = unsafe { GetWindowInfo(self.main, &mut main) };
|
let read = unsafe { GetWindowInfo(self.main, &mut main) };
|
||||||
anyhow::ensure!(read != 0, "pet: the main window's place does not read");
|
anyhow::ensure!(read != 0, "pet: the main window's place does not read");
|
||||||
let corner = stand(main.rcClient, scale, pane);
|
let mut display = MONITORINFO {
|
||||||
|
cbSize: size_of::<MONITORINFO>() as u32,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
let monitor = unsafe { MonitorFromWindow(self.main, MONITOR_DEFAULTTONEAREST) };
|
||||||
|
let read = unsafe { GetMonitorInfoW(monitor, &mut display) };
|
||||||
|
anyhow::ensure!(read != 0, "pet: the main window's display does not read");
|
||||||
|
let (_, top) = stand(main.rcClient, scale, pane, Edge::Top);
|
||||||
|
let edge = edge((top - display.rcWork.top) as f32 / scale);
|
||||||
|
let corner = stand(main.rcClient, scale, pane, edge);
|
||||||
let posted = unsafe { PostMessageW(self.pet, PLACE, pack(corner), 0) };
|
let posted = unsafe { PostMessageW(self.pet, PLACE, pack(corner), 0) };
|
||||||
anyhow::ensure!(posted != 0, "pet: her place does not post");
|
anyhow::ensure!(posted != 0, "pet: her place does not post");
|
||||||
log::debug!("pet: Ely is to stand on {corner:?}");
|
log::debug!("pet: Ely is to stand on {corner:?}, the pane's {edge:?} edge");
|
||||||
Ok(())
|
Ok(edge)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Her bottom left corner on `pane` at `scale` over the main window's `client` rect, in pixels.
|
/// Her bottom left corner on `edge` of `pane` at `scale` over the main window's `client` rect, in pixels.
|
||||||
fn stand(client: RECT, scale: f32, pane: Bounds<Pixels>) -> (i32, i32) {
|
fn stand(client: RECT, scale: f32, pane: Bounds<Pixels>, edge: Edge) -> (i32, i32) {
|
||||||
let (x, y) = (f32::from(pane.origin.x), f32::from(pane.origin.y));
|
let y = match edge {
|
||||||
|
Edge::Top => pane.origin.y,
|
||||||
|
Edge::Bottom => pane.bottom(),
|
||||||
|
};
|
||||||
|
let x = f32::from(pane.origin.x) + left(pane.size.width);
|
||||||
(
|
(
|
||||||
client.left + ((x + left(pane.size.width)) * scale).round() as i32,
|
client.left + (x * scale).round() as i32,
|
||||||
client.top + (y * scale).round() as i32,
|
client.top + (f32::from(y) * scale).round() as i32,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+57
-21
@@ -42,6 +42,28 @@ fn deliver(window: HWND) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Moves `window` to `(x, y)`, 800 by 600.
|
||||||
|
fn move_main(window: HWND, (x, y): (i32, i32)) {
|
||||||
|
let flags = SWP_NOZORDER | SWP_NOACTIVATE;
|
||||||
|
let moved = unsafe { SetWindowPos(window, std::ptr::null_mut(), x, y, 800, 600, flags) };
|
||||||
|
assert_ne!(moved, 0, "the main window moves");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The work area of the display under most of `window`.
|
||||||
|
fn work_area(window: HWND) -> RECT {
|
||||||
|
let mut display = MONITORINFO {
|
||||||
|
cbSize: size_of::<MONITORINFO>() as u32,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
let monitor = unsafe { MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST) };
|
||||||
|
assert_ne!(
|
||||||
|
unsafe { GetMonitorInfoW(monitor, &mut display) },
|
||||||
|
0,
|
||||||
|
"its display"
|
||||||
|
);
|
||||||
|
display.rcWork
|
||||||
|
}
|
||||||
|
|
||||||
fn info(window: HWND) -> WINDOWINFO {
|
fn info(window: HWND) -> WINDOWINFO {
|
||||||
let mut info = WINDOWINFO {
|
let mut info = WINDOWINFO {
|
||||||
cbSize: size_of::<WINDOWINFO>() as u32,
|
cbSize: size_of::<WINDOWINFO>() as u32,
|
||||||
@@ -70,7 +92,7 @@ unsafe extern "system" fn standin(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn her_bottom_stands_on_the_panes_top_edge_whatever_the_two_windows_dpi() {
|
fn her_bottom_stands_on_either_edge_of_the_pane_whatever_the_two_windows_dpi() {
|
||||||
let client = RECT {
|
let client = RECT {
|
||||||
left: 100,
|
left: 100,
|
||||||
top: 20,
|
top: 20,
|
||||||
@@ -79,24 +101,26 @@ fn her_bottom_stands_on_the_panes_top_edge_whatever_the_two_windows_dpi() {
|
|||||||
};
|
};
|
||||||
let pane = Bounds::new(point(px(10.), px(8.)), size(px(800.), px(600.)));
|
let pane = Bounds::new(point(px(10.), px(8.)), size(px(800.), px(600.)));
|
||||||
for (scale, dpi) in [(1.0, 96), (1.0, 144), (1.5, 96), (2.0, 120)] {
|
for (scale, dpi) in [(1.0, 96), (1.0, 144), (1.5, 96), (2.0, 120)] {
|
||||||
let her = boxed(stand(client, scale, pane), dpi);
|
for (edge, y) in [(Edge::Top, 8.0), (Edge::Bottom, 608.0)] {
|
||||||
let own = dpi as f32 / 96.0;
|
let her = boxed(stand(client, scale, pane, edge), dpi);
|
||||||
let own_box = (
|
let own = dpi as f32 / 96.0;
|
||||||
(WIDTH * own).round() as i32,
|
let own_box = (
|
||||||
((HEAD + ROOM) * own).round() as i32,
|
(WIDTH * own).round() as i32,
|
||||||
);
|
((HEAD + ROOM) * own).round() as i32,
|
||||||
let corner = (
|
);
|
||||||
100 + ((10.0 + left(px(800.))) * scale).round() as i32,
|
let corner = (
|
||||||
20 + (8.0 * scale).round() as i32,
|
100 + ((10.0 + left(px(800.))) * scale).round() as i32,
|
||||||
);
|
20 + (y * scale).round() as i32,
|
||||||
assert_eq!(
|
);
|
||||||
(
|
assert_eq!(
|
||||||
(her.right - her.left, her.bottom - her.top),
|
(
|
||||||
(her.left, her.bottom)
|
(her.right - her.left, her.bottom - her.top),
|
||||||
),
|
(her.left, her.bottom)
|
||||||
(own_box, corner),
|
),
|
||||||
"the main window at {scale}, hers at {dpi} DPI"
|
(own_box, corner),
|
||||||
);
|
"the main window at {scale}, hers at {dpi} DPI, on the {edge:?} edge"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,7 +258,7 @@ fn places_that_pile_up_across_two_displays_drain_in_her_dpis_size() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn the_large_framed_popup_gpui_makes_stands_bare_in_her_box_on_the_panes_top_edge() {
|
fn the_large_framed_popup_gpui_makes_stands_bare_in_her_box_on_an_edge_of_the_pane() {
|
||||||
let main = window(WS_OVERLAPPEDWINDOW, 0);
|
let main = window(WS_OVERLAPPEDWINDOW, 0);
|
||||||
// gpui's popup: style 0, an overlapped window, which Windows gives a caption.
|
// gpui's popup: style 0, an overlapped window, which Windows gives a caption.
|
||||||
let pet = window(0, WS_EX_TOOLWINDOW | WS_EX_TOPMOST);
|
let pet = window(0, WS_EX_TOOLWINDOW | WS_EX_TOPMOST);
|
||||||
@@ -245,8 +269,10 @@ fn the_large_framed_popup_gpui_makes_stands_bare_in_her_box_on_the_panes_top_edg
|
|||||||
);
|
);
|
||||||
unsafe { SetWindowLongPtrW(pet, GWLP_WNDPROC, standin as *const () as isize) };
|
unsafe { SetWindowLongPtrW(pet, GWLP_WNDPROC, standin as *const () as isize) };
|
||||||
let glue = Glue::hold(pet, main).expect("held");
|
let glue = Glue::hold(pet, main).expect("held");
|
||||||
|
let work = work_area(main);
|
||||||
|
move_main(main, (work.left + 200, work.top + 400));
|
||||||
let pane = Bounds::new(point(px(0.), px(0.)), size(px(380.), px(280.)));
|
let pane = Bounds::new(point(px(0.), px(0.)), size(px(380.), px(280.)));
|
||||||
glue.put(1.0, pane).expect("placed");
|
let roomy = glue.put(1.0, pane).expect("placed");
|
||||||
let made = info(pet).rcWindow;
|
let made = info(pet).rcWindow;
|
||||||
deliver(pet);
|
deliver(pet);
|
||||||
let (her, under) = (info(pet), info(main));
|
let (her, under) = (info(pet), info(main));
|
||||||
@@ -269,6 +295,11 @@ fn the_large_framed_popup_gpui_makes_stands_bare_in_her_box_on_the_panes_top_edg
|
|||||||
};
|
};
|
||||||
let (_, _, kept) = change(display);
|
let (_, _, kept) = change(display);
|
||||||
let (suggested, taken, stood) = change(display + 48);
|
let (suggested, taken, stood) = change(display + 48);
|
||||||
|
// At the work area's top the main window leaves her no room above it.
|
||||||
|
move_main(main, (work.left + 200, work.top));
|
||||||
|
let cramped = glue.put(1.0, pane).expect("placed again");
|
||||||
|
deliver(pet);
|
||||||
|
let (inside, low) = (info(pet).rcWindow, info(main).rcClient);
|
||||||
unsafe {
|
unsafe {
|
||||||
DestroyWindow(pet);
|
DestroyWindow(pet);
|
||||||
DestroyWindow(main);
|
DestroyWindow(main);
|
||||||
@@ -311,4 +342,9 @@ fn the_large_framed_popup_gpui_makes_stands_bare_in_her_box_on_the_panes_top_edg
|
|||||||
own_box,
|
own_box,
|
||||||
"no size until her window takes the posted place"
|
"no size until her window takes the posted place"
|
||||||
);
|
);
|
||||||
|
assert_eq!(
|
||||||
|
(roomy, cramped, inside.left, inside.bottom),
|
||||||
|
(Edge::Top, Edge::Bottom, low.left + 140, low.top + 280),
|
||||||
|
"with no room above, inside on the pane's bottom edge"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
+162
-21
@@ -1,20 +1,24 @@
|
|||||||
//! Ely's window on X11: gpui's popup, which no window manager places, put on the main window's top edge and just above it.
|
//! Ely's window on X11: gpui's popup, which no window manager places, put on an edge of the main window's pane and just above it.
|
||||||
|
|
||||||
use anyhow::{Context as _, bail};
|
use anyhow::{Context as _, bail};
|
||||||
use gpui::{Bounds, Pixels, Window};
|
use gpui::{Bounds, Pixels, Window, px};
|
||||||
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
||||||
use x11rb::{
|
use x11rb::{
|
||||||
protocol::xproto::{ConfigureWindowAux, ConnectionExt as _, StackMode},
|
protocol::{
|
||||||
|
randr::ConnectionExt as _,
|
||||||
|
xproto::{Atom, AtomEnum, ConfigureWindowAux, ConnectionExt as _, StackMode},
|
||||||
|
},
|
||||||
rust_connection::RustConnection,
|
rust_connection::RustConnection,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{HEAD, ROOM, left, pane};
|
use super::{Edge, HEAD, ROOM, edge, left, pane};
|
||||||
|
|
||||||
/// Her X window, the main one, and a connection of her own to their server.
|
/// Her X window, the main one, a connection of her own to their server, and the atom of the work area its window manager names.
|
||||||
pub struct Glue {
|
pub struct Glue {
|
||||||
connection: RustConnection,
|
connection: RustConnection,
|
||||||
pet: u32,
|
pet: u32,
|
||||||
main: u32,
|
main: u32,
|
||||||
|
workarea: Atom,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Glue {
|
impl Glue {
|
||||||
@@ -22,35 +26,90 @@ impl Glue {
|
|||||||
let (pet, main) = (native(pet)?, native(main)?);
|
let (pet, main) = (native(pet)?, native(main)?);
|
||||||
// gpui opens $DISPLAY too; a window's place belongs to whoever asks.
|
// gpui opens $DISPLAY too; a window's place belongs to whoever asks.
|
||||||
let (connection, _) = x11rb::connect(None).context("pet: no X server")?;
|
let (connection, _) = x11rb::connect(None).context("pet: no X server")?;
|
||||||
Ok(Self {
|
let workarea = (connection.intern_atom(false, b"_NET_WORKAREA"))?
|
||||||
|
.reply()
|
||||||
|
.context("pet: the work area's atom")?
|
||||||
|
.atom;
|
||||||
|
let glue = Self {
|
||||||
connection,
|
connection,
|
||||||
pet,
|
pet,
|
||||||
main,
|
main,
|
||||||
})
|
workarea,
|
||||||
|
};
|
||||||
|
let (root, _) = glue.frame()?;
|
||||||
|
let monitors = glue.monitors(root)?.len();
|
||||||
|
match glue.work_top(root)? {
|
||||||
|
Some(top) => {
|
||||||
|
log::info!("pet: {monitors} monitors; the work area starts {top} pixels down")
|
||||||
|
}
|
||||||
|
None => log::info!(
|
||||||
|
"pet: {monitors} monitors; the window manager names no work area, so each monitor's top bounds her"
|
||||||
|
),
|
||||||
|
}
|
||||||
|
Ok(glue)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stands her on the main window's pane, as far in as its width allows, stacked just above the main window's frame.
|
/// Stands her on the main window's pane, on its top edge while her box fits under the top of the monitor holding most of the pane, or of the work area where that lies lower, else on its bottom edge, as far in as its width allows, stacked just above the main window's frame, and gives the edge.
|
||||||
pub fn place(&self, main: &Window) -> anyhow::Result<()> {
|
pub fn place(&self, main: &Window) -> anyhow::Result<Edge> {
|
||||||
self.put(main.scale_factor(), pane(main))
|
self.put(main.scale_factor(), pane(main))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Places her at `scale` over `pane`, in the main window's points.
|
/// Places her at `scale` on an edge of `pane`, in the main window's points.
|
||||||
fn put(&self, scale: f32, pane: Bounds<Pixels>) -> anyhow::Result<()> {
|
fn put(&self, scale: f32, pane: Bounds<Pixels>) -> anyhow::Result<Edge> {
|
||||||
let (x, y) = (f32::from(pane.origin.x), f32::from(pane.origin.y));
|
|
||||||
let (root, frame) = self.frame()?;
|
let (root, frame) = self.frame()?;
|
||||||
let at = (self.connection)
|
let at = (self.connection)
|
||||||
.translate_coordinates(self.main, root, 0, 0)?
|
.translate_coordinates(self.main, root, 0, 0)?
|
||||||
.reply()
|
.reply()
|
||||||
.context("pet: the main window's place")?;
|
.context("pet: the main window's place")?;
|
||||||
|
let down = |y: Pixels| i32::from(at.dst_y) + (f32::from(y) * scale).round() as i32;
|
||||||
|
let across = |x: Pixels| i32::from(at.dst_x) + (f32::from(x) * scale).round() as i32;
|
||||||
|
let (west, top) = (across(pane.origin.x), down(pane.origin.y));
|
||||||
|
let rect = [
|
||||||
|
west,
|
||||||
|
top,
|
||||||
|
across(pane.right()) - west,
|
||||||
|
down(pane.bottom()) - top,
|
||||||
|
];
|
||||||
|
let usable = usable(&self.monitors(root)?, self.work_top(root)?, rect);
|
||||||
|
let edge = edge(usable.map_or(0.0, |usable| (top - usable) as f32 / scale));
|
||||||
|
let bottom = down(match edge {
|
||||||
|
Edge::Top => pane.origin.y,
|
||||||
|
Edge::Bottom => pane.bottom(),
|
||||||
|
});
|
||||||
let aux = ConfigureWindowAux::new()
|
let aux = ConfigureWindowAux::new()
|
||||||
.x(i32::from(at.dst_x) + ((x + left(pane.size.width)) * scale).round() as i32)
|
.x(across(pane.origin.x + px(left(pane.size.width))))
|
||||||
.y(i32::from(at.dst_y) + ((y - HEAD - ROOM) * scale).round() as i32)
|
.y(bottom - ((HEAD + ROOM) * scale).round() as i32)
|
||||||
.sibling(frame)
|
.sibling(frame)
|
||||||
.stack_mode(StackMode::ABOVE);
|
.stack_mode(StackMode::ABOVE);
|
||||||
(self.connection)
|
(self.connection)
|
||||||
.configure_window(self.pet, &aux)?
|
.configure_window(self.pet, &aux)?
|
||||||
.check()
|
.check()
|
||||||
.context("pet: the X server did not move her window")
|
.context("pet: the X server did not move her window")?;
|
||||||
|
Ok(edge)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Each monitor's x, y, width and height on the root, as RandR names them.
|
||||||
|
fn monitors(&self, root: u32) -> anyhow::Result<Vec<[i32; 4]>> {
|
||||||
|
let reply = (self.connection)
|
||||||
|
.randr_get_monitors(root, true)?
|
||||||
|
.reply()
|
||||||
|
.context("pet: the monitors")?;
|
||||||
|
let monitors = reply.monitors.iter();
|
||||||
|
Ok(monitors
|
||||||
|
.map(|m| [m.x.into(), m.y.into(), m.width.into(), m.height.into()])
|
||||||
|
.collect())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The top of the work area the window manager names in `_NET_WORKAREA`, its first desktop's, which managers keep alike; none where it names none.
|
||||||
|
fn work_top(&self, root: u32) -> anyhow::Result<Option<i32>> {
|
||||||
|
let reply = (self.connection)
|
||||||
|
.get_property(false, root, self.workarea, AtomEnum::CARDINAL, 0, 4)?
|
||||||
|
.reply()
|
||||||
|
.context("pet: the work area")?;
|
||||||
|
Ok(reply
|
||||||
|
.value32()
|
||||||
|
.and_then(|mut area| area.nth(1))
|
||||||
|
.map(|top| top as i32))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Maps her window while the main one shows, and unmaps it while that hides.
|
/// Maps her window while the main one shows, and unmaps it while that hides.
|
||||||
@@ -78,6 +137,21 @@ impl Glue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The top of the room over a pane at `[x, y, width, height]`: the top of the monitor holding most of it, as Windows and macOS pick a window's display, or the work area's top `area` where that lies lower; none off every monitor.
|
||||||
|
fn usable(monitors: &[[i32; 4]], area: Option<i32>, pane: [i32; 4]) -> Option<i32> {
|
||||||
|
let shared = |monitor: &&[i32; 4]| {
|
||||||
|
let overlap = |i: usize| {
|
||||||
|
let end = (monitor[i] + monitor[i + 2]).min(pane[i] + pane[i + 2]);
|
||||||
|
i64::from((end - monitor[i].max(pane[i])).max(0))
|
||||||
|
};
|
||||||
|
overlap(0) * overlap(1)
|
||||||
|
};
|
||||||
|
let [_, top, _, _] = (monitors.iter())
|
||||||
|
.filter(|monitor| shared(monitor) > 0)
|
||||||
|
.max_by_key(shared)?;
|
||||||
|
Some(area.map_or(*top, |area| area.max(*top)))
|
||||||
|
}
|
||||||
|
|
||||||
/// The X window gpui made for `window`.
|
/// The X window gpui made for `window`.
|
||||||
fn native(window: &Window) -> anyhow::Result<u32> {
|
fn native(window: &Window) -> anyhow::Result<u32> {
|
||||||
let handle = HasWindowHandle::window_handle(window)
|
let handle = HasWindowHandle::window_handle(window)
|
||||||
@@ -93,7 +167,8 @@ mod tests {
|
|||||||
use x11rb::{
|
use x11rb::{
|
||||||
COPY_DEPTH_FROM_PARENT,
|
COPY_DEPTH_FROM_PARENT,
|
||||||
connection::Connection as _,
|
connection::Connection as _,
|
||||||
protocol::xproto::{CreateWindowAux, MapState, WindowClass},
|
protocol::xproto::{CreateWindowAux, MapState, PropMode, WindowClass},
|
||||||
|
wrapper::ConnectionExt as _,
|
||||||
};
|
};
|
||||||
|
|
||||||
use gpui::{point, px, size};
|
use gpui::{point, px, size};
|
||||||
@@ -102,7 +177,45 @@ mod tests {
|
|||||||
use crate::testx11::Xvfb;
|
use crate::testx11::Xvfb;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn she_stands_on_the_pane_just_above_the_frame_and_hides_with_it() {
|
fn the_room_above_runs_to_the_top_of_the_monitor_holding_most_of_the_pane_or_of_the_work_area()
|
||||||
|
{
|
||||||
|
let stacked = [[0, 0, 1280, 800], [0, 800, 1280, 800]];
|
||||||
|
let low = [100, 800, 900, 600];
|
||||||
|
assert_eq!(
|
||||||
|
usable(&stacked, None, low),
|
||||||
|
Some(800),
|
||||||
|
"the lower one's top"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
usable(&stacked, Some(0), low),
|
||||||
|
Some(800),
|
||||||
|
"a work area over both monitors leaves the lower one's top"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
usable(&stacked, Some(32), [100, 300, 900, 400]),
|
||||||
|
Some(32),
|
||||||
|
"a panel atop the upper one"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
usable(&stacked, None, [100, 500, 900, 400]),
|
||||||
|
Some(0),
|
||||||
|
"across both, the upper one holds most"
|
||||||
|
);
|
||||||
|
let staggered = [[0, 0, 1280, 1024], [1280, 400, 1280, 800]];
|
||||||
|
assert_eq!(
|
||||||
|
usable(&staggered, Some(0), [1100, 400, 1000, 600]),
|
||||||
|
Some(400),
|
||||||
|
"the right one holds most, though she stands over the left"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
usable(&stacked, None, [2000, 300, 900, 400]),
|
||||||
|
None,
|
||||||
|
"off every monitor"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn she_stands_on_an_edge_of_the_pane_just_above_the_frame_and_hides_with_it() {
|
||||||
let xvfb = Xvfb::start();
|
let xvfb = Xvfb::start();
|
||||||
let (connection, screen) = x11rb::connect(Some(&xvfb.display)).expect("the test connects");
|
let (connection, screen) = x11rb::connect(Some(&xvfb.display)).expect("the test connects");
|
||||||
let root = connection.setup().roots[screen].root;
|
let root = connection.setup().roots[screen].root;
|
||||||
@@ -140,17 +253,23 @@ mod tests {
|
|||||||
&CreateWindowAux::new().override_redirect(1),
|
&CreateWindowAux::new().override_redirect(1),
|
||||||
);
|
);
|
||||||
// A window manager's frame, its title bar 20 pixels tall, round the main window.
|
// A window manager's frame, its title bar 20 pixels tall, round the main window.
|
||||||
let frame = window(root, (100, 80, 800, 620), &plain);
|
let frame = window(root, (100, 400, 800, 620), &plain);
|
||||||
let main = window(frame, (0, 20, 800, 600), &plain);
|
let main = window(frame, (0, 20, 800, 600), &plain);
|
||||||
window(root, (0, 0, 50, 50), &plain);
|
window(root, (0, 0, 50, 50), &plain);
|
||||||
let hers = x11rb::connect(Some(&xvfb.display)).expect("hers").0;
|
let hers = x11rb::connect(Some(&xvfb.display)).expect("hers").0;
|
||||||
|
let workarea = (hers.intern_atom(false, b"_NET_WORKAREA"))
|
||||||
|
.expect("the request")
|
||||||
|
.reply()
|
||||||
|
.expect("the atom")
|
||||||
|
.atom;
|
||||||
let glue = Glue {
|
let glue = Glue {
|
||||||
connection: hers,
|
connection: hers,
|
||||||
pet,
|
pet,
|
||||||
main,
|
main,
|
||||||
|
workarea,
|
||||||
};
|
};
|
||||||
let pane = Bounds::new(point(px(10.), px(10.)), size(px(380.), px(280.)));
|
let pane = Bounds::new(point(px(10.), px(10.)), size(px(380.), px(280.)));
|
||||||
glue.put(2.0, pane).expect("she is placed");
|
let roomy = glue.put(2.0, pane).expect("she is placed");
|
||||||
let check = x11rb::connect(Some(&xvfb.display))
|
let check = x11rb::connect(Some(&xvfb.display))
|
||||||
.expect("the check connects")
|
.expect("the check connects")
|
||||||
.0;
|
.0;
|
||||||
@@ -159,11 +278,15 @@ mod tests {
|
|||||||
.expect("the request")
|
.expect("the request")
|
||||||
.reply()
|
.reply()
|
||||||
.expect("her place");
|
.expect("her place");
|
||||||
|
let tall = ((HEAD + ROOM) * 2.0).round() as i32;
|
||||||
let stands = (
|
let stands = (
|
||||||
100 + ((10.0 + left(px(380.))) * 2.0).round() as i32,
|
100 + ((10.0 + left(px(380.))) * 2.0).round() as i32,
|
||||||
100 + ((10.0 - HEAD - ROOM) * 2.0).round() as i32,
|
440 - tall,
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
(roomy, i32::from(at.x), i32::from(at.y)),
|
||||||
|
(Edge::Top, stands.0, stands.1)
|
||||||
);
|
);
|
||||||
assert_eq!((i32::from(at.x), i32::from(at.y)), stands);
|
|
||||||
let order = check
|
let order = check
|
||||||
.query_tree(root)
|
.query_tree(root)
|
||||||
.expect("the request")
|
.expect("the request")
|
||||||
@@ -193,5 +316,23 @@ mod tests {
|
|||||||
assert_eq!(mapped(&check), MapState::UNMAPPED);
|
assert_eq!(mapped(&check), MapState::UNMAPPED);
|
||||||
glue.shown(true).expect("shown");
|
glue.shown(true).expect("shown");
|
||||||
assert_ne!(mapped(&check), MapState::UNMAPPED);
|
assert_ne!(mapped(&check), MapState::UNMAPPED);
|
||||||
|
// A panel reserves the screen's top 300 pixels, so the pane's top lies 70 points under it.
|
||||||
|
let area = [0, 300, 1024, 724];
|
||||||
|
(check.change_property32(PropMode::REPLACE, root, workarea, AtomEnum::CARDINAL, &area))
|
||||||
|
.expect("the request")
|
||||||
|
.check()
|
||||||
|
.expect("a work area");
|
||||||
|
let cramped = glue.put(2.0, pane).expect("she is placed again");
|
||||||
|
let low = check
|
||||||
|
.get_geometry(pet)
|
||||||
|
.expect("the request")
|
||||||
|
.reply()
|
||||||
|
.expect("her place");
|
||||||
|
let inside = 420 + ((10.0 + 280.0) * 2.0_f32).round() as i32 - tall;
|
||||||
|
assert_eq!(
|
||||||
|
(cramped, i32::from(low.x), i32::from(low.y)),
|
||||||
|
(Edge::Bottom, stands.0, inside),
|
||||||
|
"with no room above, inside on the pane's bottom edge"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+6
-6
@@ -84,7 +84,7 @@ What no check reached: no real KWin drew the blur; of Wayland desktops, only Hyp
|
|||||||
| The pointer over the terminal is the arrow | T26 | the terminal sets no pointer, so gpui's arrow shows; on X11 with the pointer over the grid, gpui asked for no I-beam ("text"), which it had asked for, and failed to load under Xvfb, before | Pass |
|
| The pointer over the terminal is the arrow | T26 | the terminal sets no pointer, so gpui's arrow shows; on X11 with the pointer over the grid, gpui asked for no I-beam ("text"), which it had asked for, and failed to load under Xvfb, before | Pass |
|
||||||
| The title bar is transparent | T11, T19 | T19 review | Pass |
|
| The title bar is transparent | T11, T19 | T19 review | Pass |
|
||||||
| Every title bar control takes its press, Ely's window buttons on Windows and Linux too | T26 | Ely `cdc5ce8`: `window_controls_occlude_what_lies_under` (each style; before, the box under Windows' caption buttons took the press), `a_wobbling_press_on_a_slot_moves_no_window` (before, the window moved), `a_wobbling_press_on_a_column_title_moves_the_window`; on the owner's PC, window messages asked the app for Windows' hit test along the title bar: v0.1.0 answered caption from end to end, T26's build answers client over the toggles and +, caption over the titles, min, max and close over Ely's buttons, and a press on close closed the app; the owner, given v0.1.1's build and these controls to click, reported it works on Windows | Pass |
|
| Every title bar control takes its press, Ely's window buttons on Windows and Linux too | T26 | Ely `cdc5ce8`: `window_controls_occlude_what_lies_under` (each style; before, the box under Windows' caption buttons took the press), `a_wobbling_press_on_a_slot_moves_no_window` (before, the window moved), `a_wobbling_press_on_a_column_title_moves_the_window`; on the owner's PC, window messages asked the app for Windows' hit test along the title bar: v0.1.0 answered caption from end to end, T26's build answers client over the toggles and +, caption over the titles, min, max and close over Ely's buttons, and a press on close closed the app; the owner, given v0.1.1's build and these controls to click, reported it works on Windows | Pass |
|
||||||
| Ely peeks over the window's top edge from behind it; her face follows the sessions; a press pets her | T46, T48, T49 | `pet::look` tests: the most pressing mark sets her mood; she moves in every mood, weeks into one too; she blinks on her own, twice at times, her eyes opening as an act begins; calm glances, then dozes with zs; a finish cheers her with a hop; work runs her eyes along the lines and taps her fingers; a wait widens her eyes and hops her twice a round; an error shakes her and runs a drop down; a press winks with a rising heart; she rises from behind the edge; a change of act eases her from her last pose, her brows easing and the marks she leaves fading; `pet` tests: a mood that changes inside a wink, an old finish cleared mid-glance and a second press mid-hop each ease her from where she was, where round 1 of T49's review found her drop 12 points; `pet::rig` tests: every layer of the icon's paths parses and stays in its box, and every mark has its layer; on macOS `shot`'s snaps, 40 in 10 s while calm, caught her breathing, blinking and glancing, and two a second apart in each mood caught her reading along, rocking her mark, fretting with her drop, cheering, and easing back to calm; `pet::x11` test under Xvfb: her window stands on the pane, just above the window manager's frame, and unmaps and maps with the main window; on macOS `shot` found her the main window's child, 112 by 124 points on its top edge 140 in, a capture of the screen showed her over the edge, and OSC 7501 reports gave her surprise, worry, eyes down and a cheer; a press on her window left the main window key and every key typed before and after it reached the program; switched off and on during an error she came back worried; on a 100-point window she stood at its left edge, and moved, resized and minimized she followed it; on Windows the `pet::windows` test, red before T48, finds the framed popup Windows makes, 1898 by 1481, bare in her own box, 168 by 185 at 150%, on the pane's top edge, and no size until her window takes the place posted to it; `pet::windows` tests, red before T48's second round: with the main window at 1, 1.5 or 2 and hers at 1, 1.25 or 1.5, her height is her own and her bottom the pane's top, where it fell 62 pixels into the terminal, and at a new DPI gpui takes the rect Windows suggests, then her box comes back on her corner, or Windows' rect stands where that box would lie on a display of another DPI; two displays side by side at 144 and 96 DPI, simulated, settle her after one change, where a corner kept always, red before T48's third round, changed her DPI back and forth; and two places piled up before either ran drain on the last corner in her DPI's size, where a keep whose DPI had passed, red before T48's fourth change, set it back and forth, and where a place sized when it was posted left her 112 by 123 at 144 DPI, red before its fifth; on a Windows 11 VM at 150%, with the main window 49 pixels from the screen's top, 0.1.4 opened her 2326 by 1654 with a caption, drawn at its bottom over the terminal, and a press inside the terminal went to her; T48's build opened her 168 by 185 without one, on the edge, the press went to the terminal, one beside her box to the program behind, and one on her to her; with the window mid-screen she showed whole on its edge; Wayland's popup is gpui's own | Pass |
|
| Ely peeks over the window's top edge from behind it, or stands inside at its bottom left where no room lies above it; her face follows the sessions; a press pets her and wakes her from a doze; nothing but her shows | T46, T48, T49, T51, T52, T53 | `pet::look` tests: the most pressing mark sets her mood; she moves in every mood, weeks into one too; she blinks on her own, twice at times, her eyes opening as an act begins; calm glances, then dozes with zs; a finish cheers her with a hop; work runs her eyes along the lines and taps her fingers; a wait widens her eyes and hops her twice a round; an error shakes her and runs a drop down; a press winks with a rising heart; she rises from behind the edge; a change of act eases her from her last pose, her brows easing and the marks she leaves fading; `pet` tests: a mood that changes inside a wink, an old finish cleared mid-glance and a second press mid-hop each ease her from where she was, where round 1 of T49's review found her drop 12 points; `pet::rig` tests: every layer of the icon's paths parses and stays in its box, and every mark has its layer; on macOS `shot`'s snaps, 40 in 10 s while calm, caught her breathing, blinking and glancing, and two a second apart in each mood caught her reading along, rocking her mark, fretting with her drop, cheering, and easing back to calm; `pet::x11` test under Xvfb: her window stands on the pane, just above the window manager's frame, and unmaps and maps with the main window; on macOS `shot` found her the main window's child, 112 by 124 points on its top edge 140 in, a capture of the screen showed her over the edge, and OSC 7501 reports gave her surprise, worry, eyes down and a cheer; a press on her window left the main window key and every key typed before and after it reached the program; switched off and on during an error she came back worried; on a 100-point window she stood at its left edge, and moved, resized and minimized she followed it; on Windows the `pet::windows` test, red before T48, finds the framed popup Windows makes, 1898 by 1481, bare in her own box, 168 by 185 at 150%, on the pane's top edge, and no size until her window takes the place posted to it; `pet::windows` tests, red before T48's second round: with the main window at 1, 1.5 or 2 and hers at 1, 1.25 or 1.5, her height is her own and her bottom the pane's top, where it fell 62 pixels into the terminal, and at a new DPI gpui takes the rect Windows suggests, then her box comes back on her corner, or Windows' rect stands where that box would lie on a display of another DPI; two displays side by side at 144 and 96 DPI, simulated, settle her after one change, where a corner kept always, red before T48's third round, changed her DPI back and forth; and two places piled up before either ran drain on the last corner in her DPI's size, where a keep whose DPI had passed, red before T48's fourth change, set it back and forth, and where a place sized when it was posted left her 112 by 123 at 144 DPI, red before its fifth; on a Windows 11 VM at 150%, with the main window 49 pixels from the screen's top, 0.1.4 opened her 2326 by 1654 with a caption, drawn at its bottom over the terminal, and a press inside the terminal went to her; T48's build opened her 168 by 185 without one, on the edge, the press went to the terminal, one beside her box to the program behind, and one on her to her; with the window mid-screen she showed whole on its edge; T51: `pet` tests: she stands on the top edge while her box fits above the pane, 123.4 points, else the bottom; on macOS 0.1.4 opened her, over a window under the menu bar, at 1081 to 1205, inside its top, as the owner saw, and T51 at its bottom edge, 92, 140 in, and over a centered window still on its top edge, 1028; the `pet::windows` tests on the owner's PC put her on the top edge 400 pixels down the work area and on the bottom edge at its top, and there the release build stood her on the top edge of a centered window, on the bottom edge of one moved to the work area's top and of a maximized one, 210 pixels in at 150%, and on the top edge again once it came back; the `pet::x11` test under Xvfb puts her on the bottom edge once `_NET_WORKAREA` leaves no room; on WSLg's X11 she stood over a window with room and inside one as tall as the screen; on WSLg's Wayland, Weston, her popup stood on the pane's top edge and, once the window was maximized, opened again on its bottom edge, at its bottom left; under Xorg with two monitors she moved to the bottom edge of a window at the lower one's top, 112x123+240+1277, and of one held mostly by a staggered monitor at its top, 112x123+1240+877; under headless Sway her anchor went (140, 0) on the top edge, then (140, 999), (140, 799) and (140, 999) on the bottom edge as the window went full screen and the output 800 and 1000 high, and full screen at the same size moved her too; T52: the `pet::look` test wakes her from a doze 400 s into calm with a press, which winks her, then she stays awLine truncated
|
||||||
|
|
||||||
## 7. Sessions panel
|
## 7. Sessions panel
|
||||||
|
|
||||||
@@ -160,16 +160,16 @@ What no check reached: no real KWin drew the blur; of Wayland desktops, only Hyp
|
|||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| The icon: Ely, a girl with long pink hair, holding a terminal | T24 | `assets/icons`, drawn at 16 to 1024 px and legible at 32; the owner saw it | Pass |
|
| The icon: Ely, a girl with long pink hair, holding a terminal | T24 | `assets/icons`, drawn at 16 to 1024 px and legible at 32; the owner saw it | Pass |
|
||||||
| macOS: the rounded square; Windows and Linux: the figure alone, flat | T24 | `elyterminal-macos.svg` on Apple's grid; `elyterminal.svg`, which the Linux tarball carries and the Windows `.ico` renders | Pass |
|
| macOS: the rounded square; Windows and Linux: the figure alone, flat | T24 | `elyterminal-macos.svg` on Apple's grid; `elyterminal.svg`, which the Linux tarball carries and the Windows `.ico` renders | Pass |
|
||||||
| `scripts/mac-app.sh` builds the app, signed ad hoc, or for a release with Developer ID and notarized, and its disk image | T24, T26, T31, T41, T43, T47 | its run: `codesign --verify --strict` passes on the app and on its copy in the image; the `.icns` holds 16 to 1024 px; the image verifies and mounts with the app beside Applications; LaunchServices opens the app as `com.zacharyzhang.elyterminal`; for v0.1.1 the Release workflow (run 959) ran it on `macos-signing`: notarization Accepted, the ticket stapled, and on this Mac the downloaded image and its app pass `codesign --verify --strict` under the Developer ID and Gatekeeper's `accepted, source=Notarized Developer ID`; the owner opened it; for v0.1.2 the Release workflow (run 1001) ran it again: the downloaded image's stapled ticket validates and Gatekeeper accepts it as `Notarized Developer ID`, and its app, version 0.1.2, passes `codesign --verify --strict --deep` under the Developer ID with the hardened runtime and is accepted the same way; for v0.1.3 the Release workflow (run 1157) ran it again, and its image and app, version 0.1.3, check the same way, as does the image rebuilt for T43 (run 1181); for v0.1.4 the Release workflow (run 1216) ran it again, and its image and app, version 0.1.4, for macOS 11.0 or later, check the same way; without the key the script stops before building | Pass |
|
| `scripts/mac-app.sh` builds the app, signed ad hoc, or for a release with Developer ID and notarized, and its disk image | T24, T26, T31, T41, T43, T47, T50 | its run: `codesign --verify --strict` passes on the app and on its copy in the image; the `.icns` holds 16 to 1024 px; the image verifies and mounts with the app beside Applications; LaunchServices opens the app as `com.zacharyzhang.elyterminal`; for v0.1.1 the Release workflow (run 959) ran it on `macos-signing`: notarization Accepted, the ticket stapled, and on this Mac the downloaded image and its app pass `codesign --verify --strict` under the Developer ID and Gatekeeper's `accepted, source=Notarized Developer ID`; the owner opened it; for v0.1.2 the Release workflow (run 1001) ran it again: the downloaded image's stapled ticket validates and Gatekeeper accepts it as `Notarized Developer ID`, and its app, version 0.1.2, passes `codesign --verify --strict --deep` under the Developer ID with the hardened runtime and is accepted the same way; for v0.1.3 the Release workflow (run 1157) ran it again, and its image and app, version 0.1.3, check the same way, as does the image rebuilt for T43 (run 1181); for v0.1.4 the Release workflow (run 1216) ran it again, and its image and app, version 0.1.4, for macOS 11.0 or later, check the same way, as does the image rebuilt for T50 (run 1256); without the key the script stops before building | Pass |
|
||||||
|
|
||||||
## 15. Release
|
## 15. Release
|
||||||
|
|
||||||
| PRD line | Task | Evidence | Status |
|
| PRD line | Task | Evidence | Status |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| A Gitea release, `vVERSION`, with the macOS disk image, a Windows zip and a Linux tarball | T25, T26, T27, T31, T41, T43, T47 | `v0.1.4` at `2d9180e`: the zip from its script on the owner's Windows VM, the tarball from its script on the owner's PC under Omarchy, the disk image from the Release workflow (run 1216), signed and notarized; published once CI run 1215 on that commit passed on macOS, Ubuntu and Windows; each file downloaded back anonymously matches the SHA-256 in the release notes, each binary holds Ely's log line, and the tag names `2d9180e`. `v0.1.3` rebuilt for T43, at `eb96109`: the zip and the tarball from their scripts on the owner's PC and its WSL, the disk image from the Release workflow (run 1181), signed and notarized, each in place of the first build of its name, once CI run 1180 on that commit passed on macOS, Ubuntu and Windows; the tag moved from `7569f00` to `eb96109`, and the release's target with it; the notes give the new SHA-256 and say the builds were replaced; each file downloaded back anonymously matches its SHA-256, each binary holds the moving marks' log line and none the old ring's element id, and the tag's source archive holds `src/sessions/orb.rs`. The first `v0.1.3` builds, at `7569f00`: the zip and the tarball from their scripts on the owner's PC and its WSL, the disk image from the Release workflow (run 1157), signed and notarized; published once CI run 1156 on that commit passed on macOS, Ubuntu and Windows; each file downloaded back anonymously matches the SHA-256 in the release notes, and the tag named `7569f00`. `v0.1.2` at `4364802`: the zip and the tarball from their scripts on the owner's PC and its WSL, the disk image from the Release workflow (run 1001), signed and notarized; published once CI run 1000 on that commit passed on macOS, Ubuntu and Windows; each file downloaded back anonymously matches the SHA-256 in the release notes, and the tag names `4364802`. `v0.1.1` at `43ea5b1`: the zip from its script on the owner's PC, the disk image from the Release workflow, signed and notarized; the Linux tarball, rebuilt for T27 from `aae7fba` by its script on the owner's PC under Omarchy, took the first one's place, and the notes say so; each downloaded back anonymously, once the repository was public, matches the SHA-256 in the release notes. `v0.1.0` at `0075667`, its three files built from that commit by their scripts and checked again: the disk image verifies and its app passes `codesign --verify --strict`; the zip's executable has the icon and no C runtime DLL; the tarball opens its window on Ubuntu 22.04; each file downloaded back matches the SHA-256 in the release notes | Pass |
|
| A Gitea release, `vVERSION`, with the macOS disk image, a Windows zip and a Linux tarball | T25, T26, T27, T31, T41, T43, T47, T50 | `v0.1.4` rebuilt for T50, at `a54f4ff`: the zip and the tarball from their scripts on the owner's PC and its WSL, the disk image from the Release workflow (run 1256), signed and notarized, each in place of the first build of its name, once CI run 1253 passed on macOS, Ubuntu and Windows on `a9be8ab`, which `a54f4ff` follows with `TASKS.md` and `tasks/reviews.md` alone; the tag moved from `2d9180e` to `a54f4ff`, and the release's target with it; the notes give the new SHA-256, add T48's fix and T49's motion, and say the builds were replaced; each file downloaded back anonymously matches its SHA-256, each binary holds the rig's log line and none the old faces' string, and the tag's source archive holds `src/pet/rig.rs` and no `src/pet/faces.rs`. The first `v0.1.4` builds, at `2d9180e`: the zip from its script on the owner's Windows VM, the tarball from its script on the owner's PC under Omarchy, the disk image from the Release workflow (run 1216), signed and notarized; published once CI run 1215 on that commit passed on macOS, Ubuntu and Windows; each file downloaded back anonymously matches the SHA-256 in the release notes, each binary holds Ely's log line, and the tag named `2d9180e`. `v0.1.3` rebuilt for T43, at `eb96109`: the zip and the tarball from their scripts on the owner's PC and its WSL, the disk image from the Release workflow (run 1181), signed and notarized, each in place of the first build of its name, once CI run 1180 on that commit passed on macOS, Ubuntu and Windows; the tag moved from `7569f00` to `eb96109`, and the release's target with it; the notes give the new SHA-256 and say the builds were replaced; each file downloaded back anonymously matches its SHA-256, each binary holds the moving marks' log line and none the old ring's element id, and the tag's source archive holds `src/sessions/orb.rs`. The first `v0.1.3` builds, at `7569f00`: the zip and the tarball from their scripts on the owner's PC and its WSL, the disk image from the Release workflow (run 1157), signed and notarized; published once CI run 1156 on that commit passed on macOS, Ubuntu and Windows; each file downloaded back anonymously matches the SHA-256 in the release notes, and the tag named `7569f00`. `v0.1.2` at `4364802`: the zip and the tarball from their scripts on the owner's PC and its WSL, the disk image from the Release workflow (run 1001), signed and notarized; published once CI run 1000 on that commit passed on macOS, Ubuntu and Windows; each file downloaded back anonymously matches the SHA-256 in the release notes, and the tag names `4364802`. `v0.1.1` at `43ea5b1`: the zip from its script on the owner's PC, the disk image from the Release workflow, signed and notarized; the Linux tarball, rebuilt for T27 from `aae7fba` by its script on the owner's PC under Omarchy, took the first one's place, and the notes say so; each downloaded back anonymously, once the repository was public, matches the SHA-256 in the release notes. `v0.1.0` at `0075667`, its three files built from that commit by their scripts and checked again: the disk image verifies and its app passes `codesign --verify --strict`; the zip's executable has the icon and no C runtime DLL; the tarball opens its window on Ubuntu 22.04; each file downloaded back matches the SHA-256 in the release notes | Pass |
|
||||||
| The Windows executable carries the icon | T25, T31, T41, T47 | its resources: icon group 1 with the seven images of `elyterminal.ico`, 16 to 256 px, and gpui's manifest (PerMonitorV2); a GUI program, importing no C runtime DLL; not yet seen on a Windows screen; v0.1.2's, v0.1.3's and v0.1.4's executables the same | Pass |
|
| The Windows executable carries the icon | T25, T31, T41, T47, T50 | its resources: icon group 1 with the seven images of `elyterminal.ico`, 16 to 256 px, and gpui's manifest (PerMonitorV2); a GUI program, importing no C runtime DLL; on a Windows 11 VM the first 0.1.4 executable, running, showed it in the taskbar; v0.1.2's, v0.1.3's and v0.1.4's executables the same, T50's rebuild with icon and manifest byte for byte the first's | Pass |
|
||||||
| The Linux tarball carries the icon and a desktop entry; the window names itself `com.zacharyzhang.elyterminal` | T25, T27, T41, T47 | on Ubuntu 22.04: `desktop-file-validate` reports nothing, every library resolves, glibc 2.35; under Xvfb `WM_CLASS` reads `com.zacharyzhang.elyterminal` twice, and under headless sway the window's `app_id` reads the same; v0.1.2's passes the same checks on Ubuntu 22.04, run in the owner's WSL, `WM_CLASS` too; T27's rebuild passes the same checks on Ubuntu 22.04, whose llvmpipe (LLVM 15) leaves the window black in a capture, the first tarball's too, while Debian 13's paints it; v0.1.3's holds the same three files, its desktop entry names `com.zacharyzhang.elyterminal`, and its binary asks for glibc 2.35 at most; v0.1.4's the same | Pass |
|
| The Linux tarball carries the icon and a desktop entry; the window names itself `com.zacharyzhang.elyterminal` | T25, T27, T41, T47, T50 | on Ubuntu 22.04: `desktop-file-validate` reports nothing, every library resolves, glibc 2.35; under Xvfb `WM_CLASS` reads `com.zacharyzhang.elyterminal` twice, and under headless sway the window's `app_id` reads the same; v0.1.2's passes the same checks on Ubuntu 22.04, run in the owner's WSL, `WM_CLASS` too; T27's rebuild passes the same checks on Ubuntu 22.04, whose llvmpipe (LLVM 15) leaves the window black in a capture, the first tarball's too, while Debian 13's paints it; v0.1.3's holds the same three files, its desktop entry names `com.zacharyzhang.elyterminal`, and its binary asks for glibc 2.35 at most; v0.1.4's the same, T50's rebuild too | Pass |
|
||||||
| Each build comes from its script | T25, T27, T31, T41, T43, T47 | `scripts/mac-app.sh` on macOS, `scripts/windows-zip.ps1` on the owner's Windows PC, `scripts/linux-tar.sh` in the owner's WSL, and for T27 on the owner's PC under Omarchy; v0.1.2's and v0.1.3's three the same way, and v0.1.3's again for T43, the disk image's on `macos-signing`; v0.1.4's zip on the owner's Windows VM, its tarball on the owner's PC under Omarchy, its disk image on `macos-signing` | Pass |
|
| Each build comes from its script | T25, T27, T31, T41, T43, T47, T50 | `scripts/mac-app.sh` on macOS, `scripts/windows-zip.ps1` on the owner's Windows PC, `scripts/linux-tar.sh` in the owner's WSL, and for T27 on the owner's PC under Omarchy; v0.1.2's and v0.1.3's three the same way, and v0.1.3's again for T43, the disk image's on `macos-signing`; v0.1.4's zip on the owner's Windows VM, its tarball on the owner's PC under Omarchy, its disk image on `macos-signing`; T50's zip on the owner's PC, its tarball in the PC's WSL, its disk image on `macos-signing` | Pass |
|
||||||
|
|
||||||
## CI notes
|
## CI notes
|
||||||
|
|
||||||
|
|||||||
@@ -250,3 +250,21 @@ Each task gets at most three codex rounds. Each round: the commit, the verdict,
|
|||||||
|
|
||||||
- Round 1, 9d9144f: FAIL. Only a change of act started her ease, so a mood that changed inside a wink dropped her 12 points mid-hop, an old finish cleared mid-glance snapped her eyes back, and a second press mid-hop dropped her too. Fixed in a9be8ab: a change of mood and a press each ease her from the pose she was in, as a change of act does; her brows ease with her.
|
- Round 1, 9d9144f: FAIL. Only a change of act started her ease, so a mood that changed inside a wink dropped her 12 points mid-hop, an old finish cleared mid-glance snapped her eyes back, and a second press mid-hop dropped her too. Fixed in a9be8ab: a change of mood and a press each ease her from the pose she was in, as a change of act does; her brows ease with her.
|
||||||
- Round 2, a9be8ab: PASS. In the reviewer's replays a mood that changed inside a wink kept her lift at 40.3 and faded the wait's mark over 0.3 s, an old finish cleared mid-glance eased her look and tilt back, and a second press mid-hop kept her lift; 160 mixes of moods, times and winks passed; macOS shot replays of all three showed the ease; check.sh passed with 237 tests. Windows ran at 9d9144f, 212 tests, and drew her; the VM was offline for the fix, which changes no Windows code.
|
- Round 2, a9be8ab: PASS. In the reviewer's replays a mood that changed inside a wink kept her lift at 40.3 and faded the wait's mark over 0.3 s, an old finish cleared mid-glance eased her look and tilt back, and a second press mid-hop kept her lift; 160 mixes of moods, times and winks passed; macOS shot replays of all three showed the ease; check.sh passed with 237 tests. Windows ran at 9d9144f, 212 tests, and drew her; the VM was offline for the fix, which changes no Windows code.
|
||||||
|
|
||||||
|
## T50
|
||||||
|
|
||||||
|
- Round 1, a54f4ff and 5d10979 with v0.1.4 rebuilt: PASS. The reviewer found T50's code, resources, scripts and workflows those of a9be8ab, where CI run 1253 passed on macOS, Ubuntu and Windows; read Release run 1256 notarize and staple the disk image at a54f4ff and put it on the release; downloaded the three files anonymously against the notes' SHA-256, each unlike the first 0.1.4's; matched the tag's source archive to a54f4ff file by file and the notes to notes.md; checked the disk image's ticket, signatures, Gatekeeper, version 0.1.4 and macOS 11.0, the zip's icon and manifest against the first build byte for byte and its imports, no C runtime DLL among them, and the tarball's files, modes and glibc 2.35; and ran the downloaded app with a HOME of its own, where Ely stood 112 by 124 on the window's top edge and moved between captures. check.sh passed. Windows and Linux windows, live multi-display DPI and Wayland went unexercised.
|
||||||
|
|
||||||
|
## T51
|
||||||
|
|
||||||
|
- Round 1, 15ef5d5: FAIL. On Wayland her bottom anchor kept the height it opened at, and a change of state at the same size never moved her; on X11 the room ran to the root's top, not her monitor's; Sway's tiling went unseen. Fixed in e6c0c14: twice a second she checks where the window's size and state put her anchor, counted from the pane as gpui counts it, and opens there again; X11 reads RandR's monitors; tiling counts where gpui reports it, for a window it draws itself, as T51's line and AGENTS now say.
|
||||||
|
- Round 2, e6c0c14: FAIL. The reviewer's replays under headless Sway moved her anchor (140,0) to (140,999), (140,799) and (140,999), and full screen at the same size moved her; but X11 picked the monitor under her bottom left corner, so over a window held mostly by a staggered monitor she stood over the gap beside it. Fixed in 8b64798: the monitor holding most of the pane, as macOS and Windows pick a window's display.
|
||||||
|
- Round 3, 8b64798: PASS. The staggered replay put her at 112x123+1240+877, her bottom on the pane's bottom; the stacked one at 112x123+240+1277; check.sh passed with 238 tests and Linux with 245. Physical multi-monitor screens went unexercised.
|
||||||
|
|
||||||
|
## T52
|
||||||
|
|
||||||
|
- Round 1, 0eb8fc5: PASS. The reviewer ran the two new tests against the parent's look.rs, where after the wink she stayed Doze with Lines eyes, and against the change, where they passed; its probes covered the 299.999 and 300 s edges, a second press counting again, an old press before a new mood, a finish's count, work, waits and errors, a press with no records at all, the zs fading, and 242 poses over three weeks; check.sh passed with 240 tests and Linux with 247. A native click, frame by frame, and five real minutes went unexercised.
|
||||||
|
|
||||||
|
## T53
|
||||||
|
|
||||||
|
- Round 1, a6c044f: PASS. On macOS 27.2 the reviewer read her panel back as mask 0x80, no shadow, key only if needed, never key, a child of the main window, its frame and content rect alike; her window 112 by 124, inside the bottom edge under the menu bar; the top 32 rows and the outer columns of her picture clear; abc reached cat. A probe that kept setStyleMask: from taking logged 'pet: Ely goes, as her window cannot be kept there' and 'pet: her panel keeps style mask 0x8081', left no child window, and the main window still took abc. check.sh passed with 240 tests. This macOS draws no edge for a titled panel, so the hairline's going awaits the owner's macOS; Windows and Linux rest on the captures supplied.
|
||||||
Reference in new issue
Block a user