structured data editor
git clone https://git.lucas.co/cce-data-editor.git
open cce-relief at the preview control, not its remembered spot
The relief preview's click now sends place-next with the pointer
location before spawning — the pointer is on the control, so its
location IS the control's — exactly ColorSelector's picker-spawn
pattern. One-shot and best-effort: consumed at the editor's map,
ignored off-cce, and every other launch path keeps the WM's
last-position restore.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/main.rs | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/main.rs b/src/main.rs
index 8c70f4b..8f5b85f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -629,6 +629,25 @@ impl DataEditorApp {
}
let local = format!("{home}/.local/bin/cce-relief");
let cmd = if std::path::Path::new(&local).exists() { local } else { "cce-relief".to_string() };
+ // Ask the compositor to open the editor at this control instead of
+ // its remembered position: the pointer is on the preview right now,
+ // so its location IS the control's location. One-shot, best-effort
+ // (`place-next` consumed at the map; ignored off-cce) — the same
+ // pattern as ColorSelector's picker spawn.
+ if let Ok(reply) = cce_ui::ipc::send_command("cce", "pointer-location") {
+ let mut px = None;
+ let mut py = None;
+ for tok in reply.split_whitespace() {
+ if let Some(v) = tok.strip_prefix("x=") {
+ px = v.parse::<f64>().ok();
+ } else if let Some(v) = tok.strip_prefix("y=") {
+ py = v.parse::<f64>().ok();
+ }
+ }
+ if let (Some(x), Some(y)) = (px, py) {
+ let _ = cce_ui::ipc::send_command("cce", &format!("place-next cce-relief {x:.0} {y:.0}"));
+ }
+ }
let mut command = std::process::Command::new(&cmd);
// A relief-valued key (the (relief) annotation, or a line_relief key
// still in integer form) targets its own single value: cce-relief