Skip to content

Add set_suspend_callback method for Android - #406

Merged
tomaka merged 1 commit into
rust-windowing:masterfrom
MortimerGoro:android_egl
Feb 15, 2018
Merged

tomaka merged 1 commit into
rust-windowing:masterfrom
MortimerGoro:android_egl

Conversation

@MortimerGoro

Copy link
Copy Markdown
Contributor

Makes it possible for glutin to register a callback when a suspend event happens on Android.

We need it to unfork Glutin on Servo. See rust-windowing/glutin#868 for more details:

@tomaka tomaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Is a callback really necessary? I understand that he current model has limitations but it seems very out of place to have a callback.

Comment thread Cargo.toml Outdated
[package]
name = "winit"
version = "0.11.0"
version = "0.11.1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't bump!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/lib.rs Outdated

/// Makes it possible for glutin to register a callback when a suspend event happens on Android
#[cfg(target_os = "android")]
pub fn set_suspend_callback(&self, cb: Option<Box<Fn(bool) -> ()>>) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be in the os::android module to be consistent with other similar methods.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@MortimerGoro

Copy link
Copy Markdown
Contributor Author

We talked about implementing that callback here: rust-windowing/glutin#868 (comment)

We didn´t find a good way to handle the suspend event on glutin (info here rust-windowing/glutin#868 (comment)). Is there a better way to do that now? I'll update the PR if there is a better solution

@tomaka

tomaka commented Feb 14, 2018

Copy link
Copy Markdown
Contributor

I'm ok with a callback if it's specific to Android.

Makes it possible for glutin to register a callback when a suspend event happens on Android
@MortimerGoro

Copy link
Copy Markdown
Contributor Author

PR updated with the requested changes

@tomaka
tomaka merged commit c62296d into rust-windowing:master Feb 15, 2018
@MortimerGoro

Copy link
Copy Markdown
Contributor Author

Could you publish v0.11.1?

@tomaka

tomaka commented Feb 19, 2018

Copy link
Copy Markdown
Contributor

@MortimerGoro Please open a PR that updates the version in Cargo.toml and CHANGELOG.md. While you're at it, also add a line for the changes of #406 in the changelog.

@chetgurevitch chetgurevitch mentioned this pull request Feb 19, 2018
sodiumjoe pushed a commit to sodiumjoe/winit that referenced this pull request Mar 19, 2018
Makes it possible for glutin to register a callback when a suspend event happens on Android
tmfink pushed a commit to tmfink/winit that referenced this pull request Jan 5, 2022
…, r=pcwalton

Simplify the cargo-c usage and generate the library as libpathfinder
@lattice0

Copy link
Copy Markdown

was this method taken away? Why? #1886

@maroider

Copy link
Copy Markdown
Member

I believe it was removed in favour of the Suspended event.

@MarijnS95 MarijnS95 added the DS - android Affects the Android backend label May 27, 2022
madsmtm pushed a commit to madsmtm/winit that referenced this pull request Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - android Affects the Android backend

Development

Successfully merging this pull request may close these issues.

5 participants