mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'imbris/fix-egui-mouse-capture' into 'master'
Fix egui capturing mouse when hidden. See merge request veloren/veloren!3140
This commit is contained in:
commit
f9ce85164f
@ -33,9 +33,15 @@ pub fn run(mut global_state: GlobalState, event_loop: EventLoop) {
|
||||
|
||||
#[cfg(feature = "egui-ui")]
|
||||
{
|
||||
global_state.egui_state.platform.handle_event(&event);
|
||||
if global_state.egui_state.platform.captures_event(&event) {
|
||||
return;
|
||||
let enabled_for_current_state =
|
||||
states.last().map_or(false, |state| state.egui_enabled());
|
||||
|
||||
// Only send events to the egui UI when it is being displayed.
|
||||
if enabled_for_current_state && global_state.settings.interface.egui_enabled() {
|
||||
global_state.egui_state.platform.handle_event(&event);
|
||||
if global_state.egui_state.platform.captures_event(&event) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user