Windows: no console, app icons, Calc tiles paint, theme switch no edit
Release apps use the GUI subsystem; workers, Git and cmd start with CREATE_NO_WINDOW. Each exe embeds its icon as resource 1, which gpui also loads for the window. Patch 0044: Win32 devices take no client buffer, so tiles and slide layers paint at full size, then copy. ely.xcd gives both schemes one notes colour: Calc rewrote the comment style on each switch and left an undo step. lo-patches.sh keeps LF. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f3bf816c40
commit
09d2a6b681
30 files changed
+189
-6
No files matched your search
@@ -4,6 +4,18 @@ mod relay;
|
||||
pub use relay::{Relay, relay};
|
||||
|
||||
use std::io::{self, Read, Write};
|
||||
use std::process::Command;
|
||||
|
||||
/// A child that opens no console window on Windows.
|
||||
pub fn windowless(command: &mut Command) -> &mut Command {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use std::os::windows::process::CommandExt as _;
|
||||
// CREATE_NO_WINDOW
|
||||
command.creation_flags(0x0800_0000);
|
||||
}
|
||||
command
|
||||
}
|
||||
|
||||
/// A frame: u32 length, u8 tag, u64 request id, payload.
|
||||
pub const MAX_FRAME: usize = 64 * 1024 * 1024;
|
||||
|
||||
@@ -147,7 +147,7 @@ impl Worker {
|
||||
let worker_bin = worker_bin()?;
|
||||
log::info!("lok: worker from {}", worker_bin.display());
|
||||
let mut command = Command::new(worker_bin);
|
||||
command
|
||||
ely_ipc::windowless(&mut command)
|
||||
.arg(install)
|
||||
.arg(profile_dir)
|
||||
.env("SAL_FORCE_HIDPI_SCALING", "1")
|
||||
|
||||
@@ -180,3 +180,18 @@ pub(super) fn open_book(text: &str) -> (tempfile::TempDir, Worker, Doc) {
|
||||
.expect("the area");
|
||||
(dir, worker, doc)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_theme_switch_is_no_edit() {
|
||||
if install().is_none() {
|
||||
eprintln!("SKIP: no pinned LOK build");
|
||||
return;
|
||||
}
|
||||
let (_dir, mut worker, doc) = open_book(FODS);
|
||||
for scheme in ["COLOR_SCHEME_ELY_DARK", "COLOR_SCHEME_ELY_LIGHT"] {
|
||||
worker.run(&doc, "view.theme", &[scheme]).expect("the theme runs");
|
||||
let undo = worker.values(&doc, ".uno:Undo").expect("the undo stack");
|
||||
let undo: serde_json::Value = serde_json::from_str(&undo).expect("undo JSON");
|
||||
assert_eq!(undo["actions"], "", "{scheme} left undo steps");
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ impl Worker {
|
||||
|
||||
/// Spawns `bin`; one from other sources is refused.
|
||||
pub fn spawn_from(bin: &Path) -> io::Result<Self> {
|
||||
let mut child = Command::new(bin)
|
||||
let mut child = ely_ipc::windowless(&mut Command::new(bin))
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
|
||||
@@ -10,6 +10,7 @@ publish.workspace = true
|
||||
anyhow.workspace = true
|
||||
arboard.workspace = true
|
||||
directories.workspace = true
|
||||
ely-ipc.workspace = true
|
||||
env_logger.workspace = true
|
||||
image.workspace = true
|
||||
log.workspace = true
|
||||
|
||||
@@ -118,7 +118,7 @@ pub fn open_default(path: &Path) -> io::Result<()> {
|
||||
} else {
|
||||
Command::new("xdg-open")
|
||||
};
|
||||
let out = command.arg(path).output()?;
|
||||
let out = ely_ipc::windowless(&mut command).arg(path).output()?;
|
||||
if !out.status.success() {
|
||||
let said = String::from_utf8_lossy(&out.stderr).trim().to_owned();
|
||||
return Err(io::Error::other(said));
|
||||
|
||||
@@ -45,7 +45,7 @@ pub fn parse_version(text: &str) -> Option<(u32, u32)> {
|
||||
|
||||
/// What `git --version` says, once it succeeds.
|
||||
pub fn version_of(path: &Path) -> io::Result<(String, (u32, u32))> {
|
||||
let output = Command::new(path).arg("--version").output()?;
|
||||
let output = ely_ipc::windowless(&mut Command::new(path)).arg("--version").output()?;
|
||||
if !output.status.success() {
|
||||
let said = String::from_utf8_lossy(&output.stderr).trim().to_string();
|
||||
return Err(io::Error::other(format!("{} --version failed ({}): {said}", path.display(), output.status)));
|
||||
@@ -83,7 +83,7 @@ fn own(dir: &Path) -> PathBuf {
|
||||
/// Git at `git` in `dir`, as Ely runs it.
|
||||
pub fn command(git: &Path, dir: &Path, args: &[&str]) -> Command {
|
||||
let mut command = Command::new(git);
|
||||
command
|
||||
ely_ipc::windowless(&mut command)
|
||||
.args(args)
|
||||
.current_dir(dir)
|
||||
// Reads never take the index lock from an outside Git.
|
||||
|
||||
Reference in new issue
Block a user