Skip to content

Commit 5530e8f

Browse files
authored
make bevy_input_focus dep on bevy_picking optional (#21659)
# Objective - Fixes #21413 ## Solution - make bevy_input_focus dep on bevy_picking optional ## Testing - ci
1 parent ca13690 commit 5530e8f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

crates/bevy_input_focus/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bevy_app = { path = "../bevy_app", version = "0.18.0-dev", default-features = fa
6464
bevy_ecs = { path = "../bevy_ecs", version = "0.18.0-dev", default-features = false }
6565
bevy_input = { path = "../bevy_input", version = "0.18.0-dev", default-features = false }
6666
bevy_math = { path = "../bevy_math", version = "0.18.0-dev", default-features = false }
67-
bevy_picking = { path = "../bevy_picking", version = "0.18.0-dev", default-features = false }
67+
bevy_picking = { path = "../bevy_picking", version = "0.18.0-dev", default-features = false, optional = true }
6868
bevy_window = { path = "../bevy_window", version = "0.18.0-dev", default-features = false }
6969
bevy_reflect = { path = "../bevy_reflect", version = "0.18.0-dev", features = [
7070
"glam",

crates/bevy_input_focus/src/tab_navigation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use bevy_input::{
3838
keyboard::{KeyCode, KeyboardInput},
3939
ButtonInput, ButtonState,
4040
};
41-
use bevy_picking::events::{Pointer, Press};
4241
use bevy_window::{PrimaryWindow, Window};
4342
use log::warn;
4443
use thiserror::Error;
@@ -346,6 +345,7 @@ impl Plugin for TabNavigationPlugin {
346345
fn build(&self, app: &mut App) {
347346
app.add_systems(Startup, setup_tab_navigation);
348347
app.add_observer(acquire_focus);
348+
#[cfg(feature = "bevy_picking")]
349349
app.add_observer(click_to_focus);
350350
}
351351
}
@@ -356,8 +356,9 @@ fn setup_tab_navigation(mut commands: Commands, window: Query<Entity, With<Prima
356356
}
357357
}
358358

359+
#[cfg(feature = "bevy_picking")]
359360
fn click_to_focus(
360-
press: On<Pointer<Press>>,
361+
press: On<bevy_picking::events::Pointer<bevy_picking::events::Press>>,
361362
mut focus_visible: ResMut<InputFocusVisible>,
362363
windows: Query<Entity, With<PrimaryWindow>>,
363364
mut commands: Commands,

crates/bevy_internal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ pan_camera = ["bevy_camera_controller/pan_camera"]
316316
bevy_remote = ["dep:bevy_remote", "serialize"]
317317

318318
# Provides picking functionality
319-
bevy_picking = ["dep:bevy_picking"]
319+
bevy_picking = ["dep:bevy_picking", "bevy_input_focus?/bevy_picking"]
320320

321321
# Provides a mesh picking backend
322322
mesh_picking = ["bevy_picking", "bevy_picking/mesh_picking"]

0 commit comments

Comments
 (0)