Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resize main window using mouse #126

Closed
JoshLambda opened this issue Oct 2, 2022 · 2 comments · Fixed by #128
Closed

Cannot resize main window using mouse #126

JoshLambda opened this issue Oct 2, 2022 · 2 comments · Fixed by #128

Comments

@JoshLambda
Copy link

JoshLambda commented Oct 2, 2022

Thanks for the very useful crate that bevy_egui is.

Trying to resize window using mouse doesn't work, as confirmed using example simple.rs.
When putting mouse cursor near a window edge, the cursor doesn't change into resizing style (thin double arrow cursor) and there is no way to resize the window.

Versions (current):
bevy = "0.8.1"
bevy_egui = "0.16.1"

Without bevy_egui this simple example works:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .run();
}

When adding bevy_egui resizing window with mouse doesn't work anymore:

use bevy::prelude::*;
use bevy_egui::EguiPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(EguiPlugin)
        .run();
}

By default, for bevy WinitSettings the value for focused_ mode is UpdateMode::Continuous which is needed for games, and we can observe the problem that the cursor doesn't change to resizing style when near window edges.

And when we change focused_mode to UpdateMode::Reactive, with adding:

.insert_resource(WinitSettings {
   focused_mode: UpdateMode::Reactive {
       max_wait: std::time::Duration::from_secs(1),
   },
   ..Default::default()
})

... the cursor at first correctly switches to resize style when nearing window edge, but then reverts to arrow within less than a second, which matches the 1 second wake up delay set with UpdateMode::Reactive above.

So apparently the resize action is cancelled when bevy wakes up, or more probably at each beginning of its cycle (as witnessed with UpdateMode::Continuous). I couldn't find where exactly though.

@JoshLambda JoshLambda changed the title Trying to resize window using mouse doesn't work Cannot resize window using mouse Oct 2, 2022
@JoshLambda JoshLambda changed the title Cannot resize window using mouse Cannot resize main window using mouse Oct 2, 2022
@mvlabat
Copy link
Owner

mvlabat commented Nov 13, 2022

It seems that #128 fixes the issue. But if the problem still persists, feel free to comment here (I'll re-open the issue then) or open a new one.

@JoshLambda
Copy link
Author

I confirm it now works properly on my end. Thank you and @chronicl for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants