bevy_panorbit_camera icon indicating copy to clipboard operation
bevy_panorbit_camera copied to clipboard

egui: camera does not ignore input when the cursor is over an `egui::Window`

Open Algorhythm-sxv opened this issue 5 months ago • 5 comments

I have an egui::Window that sits over the viewport that controls the PanOrbitCamera. In this window I have a dropdown with a large number of items that gets a scrollbar. Scrolling this menu also zooms the camera in and out, which is undesirable.

Investigating further it seems as long as the cursor isn't directly interacting with a widget then PanOrbitCamera still recognises the input, although this behaviour is very inconsistent.

I suspect this change may be caused by the recent update to bevy_egui 0.35.0, which among other things related EguiContext objects to specific Camera entities: see commit

It may just be coincidence that the current version of bevy_panorbit_camera wasn't broken by the update, but this may have changed some behaviour relating to input handling.

Algorhythm-sxv avatar Jul 04 '25 14:07 Algorhythm-sxv

Hi there. I'm confused when you say you suspect it's due to a change in bevy_egui 0.35, but you created this issue before bevy_panorbit_camera was updated to use bevy_egui 0.35. Then you say this plugin wasn't broken. So exactly what version were you getting the bug in?

Either way, could you test with v0.27? If you can still reproduce I'd appreciate a minimal reproduction I can test with.

Plonq avatar Jul 04 '25 23:07 Plonq

Sorry, I see the confusion now, by the plugin not being broken I meant the code would still compile with the new version of bevy_egui.

The update to v0.27 improved the behaviour but did not fix it completely: If I spam scrolling while hovering an egui area (sidebar, menubar, window), the camera will occasionally pick up one of these inputs and zoom the view slightly. Unfortunately in trying to create a minimal example I can't reproduce the behaviour, with just a single egui window the scrolling works as expected

Algorhythm-sxv avatar Jul 06 '25 16:07 Algorhythm-sxv

When you say spam scrolling, is it possible the mouse is briefly moving outside the egui area? Perhaps you have some sort of smooth scroll that will keep sending scroll events for a few hundred milliseconds after you actually scroll?

Plonq avatar Jul 07 '25 06:07 Plonq

No I keep the pointer still over the egui elements, I have uploaded a video showing the behaviour here: imgur link

I am spamming the scroll wheel back and forth while keeping my cursor over the egui window area, and sometimes over the widgets.

Algorhythm-sxv avatar Jul 07 '25 07:07 Algorhythm-sxv

I had the same problem, the input has not been ignored at all when my cursor was over an egui window after updating from 0.26 to 0.27. The problem for me was that i didn't update bevy_egui version to 0.35. In this version they moved from the EguiContextPass to the EguiPrimaryContextPass so when the PanOrbit camera uses the newer version, the context passes cannot be compatible. So maybe you can try to look inside your Cargo.lock if you still have some old bevy_egui version other than 0.35

Turtoise1 avatar Aug 11 '25 11:08 Turtoise1