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

Re-export winit::platform::android::activity::* in bevy_winit #10630

Closed
Litttlefish opened this issue Nov 18, 2023 · 3 comments · Fixed by #11011
Closed

Re-export winit::platform::android::activity::* in bevy_winit #10630

Litttlefish opened this issue Nov 18, 2023 · 3 comments · Fixed by #11011
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy O-Android Specific to the Android mobile operating system

Comments

@Litttlefish
Copy link
Contributor

Litttlefish commented Nov 18, 2023

What problem does this solve or what need does it fill?

I want to set a fullscreen flag in my android game, but since the bevy_winit didn't re-export it, I can't set it.

code like this

    #[cfg(target_os = "android")]
    {
        use bevy::winit::platform::android::activity::WindowManagerFlags;
        let android_app = bevy::winit::ANDROID_APP
            .get()
            .expect("Bevy must be set up with the #[bevy_main] macro on Android");
        android_app.set_window_flags(
            WindowManagerFlags::FULLSCREEN,
            WindowManagerFlags::FORCE_NOT_FULLSCREEN,
        );
    }

will simply give a compile error.

What solution would you like?

Just add a pub use in bevy_winit crate I think.

What alternative(s) have you considered?

no for now

Additional context

At first I want to simply re-export winit::platform::android::activity::WindowManagerFlags, but I think maybe others need more than this.

@Litttlefish Litttlefish added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 18, 2023
@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in O-Android Specific to the Android mobile operating system C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 18, 2023
@alice-i-cecile
Copy link
Member

As a workaround, you should be able to depend directly on winit and use their type, as long as the version matches.

That said, we do tend to re-export these. This particular one should be gated on an android feature flag though :)

@Litttlefish
Copy link
Contributor Author

Litttlefish commented Nov 18, 2023

Ok, my temporary workaround is adding android-activity 0.4.3 in cargo.toml then use it directly in code, usable for now

@hecksmosis
Copy link
Contributor

I'll do this

github-merge-queue bot pushed a commit that referenced this issue Dec 19, 2023
# Objective

- Fixes #10630

## Solution

- Reexport winit::platform::android::activity::* in bevy_init

---------

Co-authored-by: François <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy O-Android Specific to the Android mobile operating system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants