From 560aa61e91ad10a3f96c4648d120b683772ad7d3 Mon Sep 17 00:00:00 2001 From: iLostName <55976057+iLostName@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:05:45 +0100 Subject: [PATCH 1/4] server packs: the download prompt keeps the pointer and stops the walking behind it --- crates/horizon-client/src/game.rs | 6 ++++-- crates/horizon-client/src/game/server_packs.rs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 0719878eb..5b87d0ced 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -5152,8 +5152,10 @@ impl Game<'_> { if self.lan_acting.is_some() { return; } - // MouseHandler.grabMouse never captures an inactive window. - if capture && !self.focused { + // MouseHandler.grabMouse never captures an inactive window, and vanilla + // grabs only on `setScreen(null)`: the pack prompt and server dialogs + // are screens over the world that keep the pointer. + if capture && (!self.focused || self.server_packs.prompt.is_some() || self.dialog_open()) { return; } // The container screen's press state belongs to the screen: a screen diff --git a/crates/horizon-client/src/game/server_packs.rs b/crates/horizon-client/src/game/server_packs.rs index 58d25de0e..92bca689b 100644 --- a/crates/horizon-client/src/game/server_packs.rs +++ b/crates/horizon-client/src/game/server_packs.rs @@ -244,6 +244,8 @@ impl Game<'_> { open.requests.push((p.id, p.url, p.hash)); open.required = p.required; open.prompt = text; + // Gui.setScreen: KeyMapping.releaseAll, so no walking behind the prompt. + self.keys.clear(); self.capture(false); } /// `handleResourcePackPop`: one pack, or all of them. From 86474679dbbcae9edae5a4d48d9c8f94cdc7cb15 Mon Sep 17 00:00:00 2001 From: iLostName <55976057+iLostName@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:26:13 +0100 Subject: [PATCH 2/4] server packs: the prompt takes the open screen's place, as PackConfirmScreen does --- crates/horizon-client/src/game.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 5b87d0ced..a5bc46929 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -5602,7 +5602,14 @@ impl Game<'_> { // Screen.extractBlurredBackground blurs the world and HUD, while the // screen's background, widgets, toasts and debug overlay stay sharp. batch.blur_at = batch.vertices.len() as u32; - match self.screen { + // PackConfirmScreen takes the open screen's place (it comes back once + // the prompt is answered): the screen under the prompt isn't drawn. + let screen = if self.server_packs.prompt.is_some() { + Screen::Playing + } else { + self.screen + }; + match screen { Screen::Paused if self.pause_menu => self.draw_pause_menu(&mut batch), // PauseScreen(false): only its title, at the top. Screen::Paused => { @@ -5641,9 +5648,11 @@ impl Game<'_> { self.draw_saving_indicator(&mut batch); self.draw_toasts(&mut batch); self.draw_pack_toasts(&mut batch); - self.remote_hud(&mut batch); - self.draw_sign_editor(&mut batch); - self.draw_book(&mut batch); + if self.server_packs.prompt.is_none() { + self.remote_hud(&mut batch); + self.draw_sign_editor(&mut batch); + self.draw_book(&mut batch); + } batch } fn creative_inventory_open(&self) -> bool { From 5f5a43fd54d993702dc2e5076cd855e0022c22b6 Mon Sep 17 00:00:00 2001 From: iLostName <55976057+iLostName@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:47:50 +0100 Subject: [PATCH 3/4] focus loss doesn't open the pause menu over the pack prompt or a server dialog --- crates/horizon-client/src/game.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index a5bc46929..2f670df64 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -12026,13 +12026,16 @@ impl ApplicationHandler for Game<'_> { self.left = false; self.right = false; self.capture(false); - // Screens (books, signs) stay open instead of pausing. + // Gui.setPauseScreen: an open screen (books, signs, the + // pack prompt, a server dialog) stays instead of pausing. if self.screen == Screen::Playing && self.player.is_some() && !self.options.no_pause && self.settings.file.bool("pauseOnLostFocus") && self.book.is_none() && self.sign_edit.is_none() + && self.server_packs.prompt.is_none() + && !self.dialog_open() { self.screen = Screen::Paused; } From 7a62c6f4a7edacaee9dac576bb766c8f7bc0feaa Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 22:46:23 +0100 Subject: [PATCH 4/4] Give the capture test's fixture the pack prompt capture() now asks the server pack prompt and the dialog; the fixture gets both, and the prompt's own case: it keeps the pointer. Co-Authored-By: Claude Opus 5.5 --- tests/test_world_input_capture.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test_world_input_capture.py b/tests/test_world_input_capture.py index 5607c3684..e9a93ee4e 100644 --- a/tests/test_world_input_capture.py +++ b/tests/test_world_input_capture.py @@ -86,25 +86,39 @@ impl Window { struct Mouse { ignore_first: bool } impl Mouse { fn set_ignore_first_move(&mut self) { self.ignore_first = true; } } struct Remote; +#[derive(Default)] +struct ServerPacks { prompt: Option<()> } struct Game { focused: bool, agent_pointer: bool, window: Option, mouse: Mouse, captured: bool, title: Option<()>, screen: Screen, remote: Option, mining: bool, lan_acting: Option, renderer: Option, cursor: (f32, f32), + server_packs: ServerPacks, } impl Default for Game { fn default() -> Self { Self { focused: true, agent_pointer: false, window: Some(Window::default()), mouse: Mouse::default(), captured: false, title: None, screen: Screen::Playing, remote: None, mining: false, lan_acting: None, - renderer: None, cursor: (0.0, 0.0) } + renderer: None, cursor: (0.0, 0.0), server_packs: ServerPacks::default() } } } impl Game { fn stop_mining(&mut self) { self.mining = false; } fn reset_inventory_clicks(&mut self) {} + fn dialog_open(&self) -> bool { false } METHODS } fn main() { + // The server pack prompt keeps the pointer: nothing grabs it while it is open. + { + let mut game = Game::default(); + game.server_packs.prompt = Some(()); + game.capture(true); + assert!(!game.captured); + game.server_packs.prompt = None; + game.capture(true); + assert!(game.captured); + } // New and existing worlds, returning to title, and reopening a world. for remote in [false, true] { let mut game = Game::default();