Skip to content

Mouse motion delta malfunction when accessing app from remote desktop #19111

Open
@Galedon

Description

@Galedon

Bevy version

cargo.toml:

[package]
name = "Vis3D"
version = "0.1.0"
edition = "2024"

# Enable a small amount of optimization in the dev profile.
[profile.dev]
opt-level = 1

# Enable a large amount of optimization in the dev profile for dependencies.
[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = { version = "0.16.0", features = ["dynamic_linking"] }

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

2025-05-07T05:52:28.144795Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3050", vendor: 4318, device: 9604, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "560.94", backend: Vulkan }
2025-05-07T05:52:28.313534Z  INFO bevy_render::batching::gpu_preprocessing: GPU preprocessing is fully supported on this device.
2025-05-07T05:52:28.327202Z  INFO bevy_winit::system: Creating new window App (0v1)

What you did

I read mouse motion delta:

use bevy::prelude::*;
use bevy::input::mouse::{MouseMotion, };

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Update, (
            read_mouse_movement
        ))
        .run();
}
fn read_mouse_movement(
    mouse: Res<ButtonInput<MouseButton>>,
    mut motion_events: EventReader<MouseMotion>
){
    if mouse.pressed(MouseButton::Right){
        for motion in motion_events.read() {
            println!("{:?}", motion);
        }
    }
}

What went wrong

When controlling PC directly, no problem appears.
When controlling PC using remote desktop protocol (build-in Windows rdp):
Getting absolute position of the cursor, but only if its being moved

output normal:

MouseMotion { delta: Vec2(2.0, -1.0) }
MouseMotion { delta: Vec2(2.0, -1.0) }
MouseMotion { delta: Vec2(1.0, -2.0) }
MouseMotion { delta: Vec2(3.0, -1.0) }
MouseMotion { delta: Vec2(2.0, 1.0) }
MouseMotion { delta: Vec2(2.0, 1.0) }

output with RDP:

MouseMotion { delta: Vec2(37011.0, 24333.0) }
MouseMotion { delta: Vec2(36670.0, 24859.0) }
MouseMotion { delta: Vec2(36579.0, 25101.0) }
MouseMotion { delta: Vec2(36579.0, 25546.0) }
MouseMotion { delta: Vec2(36602.0, 25870.0) }
MouseMotion { delta: Vec2(36761.0, 26315.0) }

Related question: #19056

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-BugAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions