Repository navigation
Conversation
…it (a tab closes, as in a browser)
…onInteractionHandlers with its middle_click and matches the TypeScript onMiddleClick
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Decoration nodes accept
onClick,onHoverChangeandonActiveChange, but nothing reacts to the middle button. A config that draws tabs in the decoration cannot close a tab on a middle click, as a browser does.Fix
packages/shoji_wm/src/types.ts:ComponentProps.onMiddleClick?: () => void, documented in English and Japanese.packages/shoji_wm/src/serialize.ts:onMiddleClickis serialized as a runtime handler, with the same path naming as the other handlers.ssd/bridge.rs:WireProps.on_middle_click; only theruntime-handlerkind is accepted, other kinds giveUnsupportedNodeKind.ssd/mod.rs:DecorationInteractionHandlers.middle_click: Option<String>;has_anycounts it, so a node with onlyonMiddleClickis tracked as an interaction target.input.rs: on a press of button 274 (BTN_MIDDLE),middle_click_decoration_targetfinds the tracked decoration target under the pointer and invokes its handler. The left-button paths are unchanged.shojiwm_rs/src/view.rs:Element::on_middle_click(f)for the Rust SDK. It registers the handler as{id}#middle_clickand fillsmiddle_click, so the Rust and TypeScript configs behave the same.Tests
No test is added.
cargo test --workspacepasses, except two tests that also fail on upstreammainin our environment:evaluator::tests::embedded_runtime_ipc_does_not_leak_fds_across_reloadsandinput_method_keyboard_grab_gets_the_keymap_of_the_keys_it_is_sent.This change has been running daily in the author's own session (a Windows-7-like desktop on ShojiWM), where a middle click closes a tab.