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

Glow/Android Only: Going directly from eframe to Home breaks the eframe on resume #3861

Closed
m-hugo opened this issue Jan 22, 2024 · 1 comment · Fixed by #3867
Closed

Glow/Android Only: Going directly from eframe to Home breaks the eframe on resume #3861

m-hugo opened this issue Jan 22, 2024 · 1 comment · Fixed by #3867
Labels
android bug Something is broken eframe Relates to epi and eframe

Comments

@m-hugo
Copy link

m-hugo commented Jan 22, 2024

now on master everything android work except for this very specific scenario:

  • open app
  • press Home button
  • go back to the app
  • it crashes
#[no_mangle]
fn android_main(app: AndroidApp) {
    let options = NativeOptions {
        event_loop_builder: Some(Box::new(move |builder| {
            builder.with_android_app(app);
        })),
        ..Default::default()
    };
    eframe::run_native(
        "My egui App",
        options,
        anything,
    )
}
eframe = { git = "https://github.com/emilk/egui", default-features = false, features = [
  "glow",
  "default_fonts",
  "android-native-activity"
] }

timeline:

@m-hugo m-hugo added the bug Something is broken label Jan 22, 2024
@emilk emilk changed the title Glow/Android Only: Going directly from EFrame to Home breaks the EFrame on resume Glow/Android Only: Going directly from eframe to Home breaks the eframe on resume Jan 22, 2024
@emilk emilk added eframe Relates to epi and eframe android labels Jan 22, 2024
@Garoven
Copy link
Contributor

Garoven commented Jan 23, 2024

@m-hugo can you test if this #3867 fixes the bug ?

emilk pushed a commit that referenced this issue Jan 24, 2024
Addition for <#3847>
In previous one i only fixed crash occurring with Wgpu backend. This
fixes crash with Glow backend as well.
I only tested this change with android so most things i changed are
behind ```#[cfg(target_os = "android")]```.

Both fixes are dirty thought. As
<#3172> says that "The root viewport
is the original viewport, and cannot be closed without closing the
application.". So they break rules i guess? But i can't think about
better solution for now.

Closes <#3861>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something is broken eframe Relates to epi and eframe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants