* Add puffin profile scopes to the startup and running of eframe
* puffin_profiler example: start puffin right away
* cargo format let-else statements
* More profile scopes
* Add some `#[inline]`
* Standardize puffin profile scope definitions
* standardize again
* Silence warning when puffin is disabled
* Silence a few clippy warnings
* Use named threads
* Remove some deprecated functions
* Document Context and Ui fully
* Use `parking_lot::Mutex` in `eframe`
* Expand clippy.toml files
* build fix
* Get a reference to `IntegrationInfo`
* Add doc comment
* Change `info` to return a reference
* Clone integration info
* Remove `&`
* Clone integration info in another place
* Fix the app only taking up half the screen size on iPad
* Fix request_repaint not working on iOS
* Always use run_and_exit on iOS since run_and_return is not supported by winit on iOS right now.
* Fix typo
* Fix eframe glow on ios
* Handle more cases
We had a bunch of `cfg!(windows)` and `cfg!(macos)` which should
have been `cfg!(target_os = "windows")`.
I wonder what the effects of this PR will be fore Windows 😬
* Bump `wgpu` to 0.17.0
This required bumping wasm-bindgen to 0.2.87
* cargo deny exception for `foreign-types`
* sort deny.toml
* Add fragile-send-sync-non-atomic-wasm feature to wgpu
* cargo deny: ignore children of foreign-types
---------
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
In `0.22.0`, `eframe::start_web` has been replaced with `eframe::WebRunner`, which also installs a nice panic hook (no need for `console_error_panic_hook`).
A window may not always be available and may have already been closed by the time an eframe app is closing. An example of this is Android, where the main activity window may have been stopped or discarded because the app is no longer in the foreground, and then the user decides to close your app without resuming it using the multitasking view.
In this case, skip the window persistence step if it does not exist anymore by the time we are saving the persistence data. Currently eframe will panic with `winit window doesn't exist` instead.
* Triage for GL backend
* And cargo-fmt
* Changelog update with PR and issue
* Update crates/eframe/src/epi/mod.rs
Co-authored-by: Andreas Reich <r_andreas2@web.de>
* Update crates/egui-wgpu/src/winit.rs
Co-authored-by: Andreas Reich <r_andreas2@web.de>
* Add "supports_screenshot" to surface state
* Cranky fix
* fmt
---------
Co-authored-by: Andreas Reich <r_andreas2@web.de>
* Expose raw window and display handles in eframe
* Ensure that no one implements `Clone` in the future
* Cleanup
---------
Co-authored-by: Matti Virkkunen <mvirkkunen@gmail.com>
The approach of #1889 may remove observers in a view
twice, which produces the Obj-C Exception:
Cannot remove an observer <...> for the key path
"nextResponder" from <WinitView ...> because
it is not registered as an observer.
The above message can only be seen when attaching the
application to debugger. Users normally see:
[1] *** trace trap cargo run
This commit fixes it by only running `event_loop.run_return()`
twice on Windows. Besides:
* We have set `ControlFlow::Exit` on `Event::LoopDestroyed`,
`EventResult::Exit` and on error; therefore, it is safe
to not calling `set_exit()`.
* This commit also fix the persistence function in macOS.
It can't store the content in Memory due to this exception.
Fixed: #2768 (eframe: "App quit unexpectedly" on macOS)
Signed-off-by: pan93412 <pan93412@gmail.com>
* Add an optional app_id field to eframe's NativeOptions (#1600).
This is used in the window builder to set the application ID, which is e.g. important for a proper configuration in `.desktop` files under Wayland.
When no application ID is explicitly set, it defaults to the title of the window.
* Only enable NativeOptions::app_id under Linux.
The wayland feature is not sufficent as constraint and it won't compile e.g. under Windows.
While Wayland could also be used on other Unix-Systems like FreeBSD, this would probably need some specific testing. Winit uses the following definition as "wayland_platform" and on which the required packages are available:
> wayland_platform: { all(feature = "wayland", free_unix, not(wasm), not(redox)) },
* Do not use title as default application ID under Wayland.
The title might be used to also communicate state (opened file, ...) to the user and this might have unforeseen consequences for the application ID. It seems to be better to use the old behavior of not setting an application ID in this case. Also add an example on how to set the application ID in the documentation.
* Avoid as_deref(), which was a left-over of a previous version
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Detect panics during initialization and show them to the user
* PanicHandler now also logs the panics
* Add example of how to call into your app from JS
* Refactor: break out AppRunner and AppRunnerRef to own files
* Hide AppRunner
* Simplify user code
* AppRunnerRef -> WebRunner
* Better docs
* Don't paint until first animation frame
* Update multiple_apps.html
* Update web demo
* Cleanup and fixes
* left-align panic message in html
* Add Pointer::is_decidedly_dragging and could_any_button_be_click
This allows users to distinguish between click and drags
while they are not yet done.
* Fix warning in eframe
* fix typo
* Log warning instead of error when failing to decode RON in storage
* New web demo
* Clean up some warn/error logging
* Avoid deadlock that could happen on crash
* Log errors using console.warn, because console.error can cause crashes
* Use patched version of wasm-bindgen-cli, allowing >2GB memory
* New web demo
* Make wgpu webgl/gles opt-in (but still work out of the box via feature flag), workaround canvas creation issue
* missing allow unsafe code annotations
* add breaking change not to eframe release notes
* Add --webgpu flag to build_demo_web.sh
* Improve CHANGELOG docs
* Clean up, and prepare for having to wasm:s
* put canvas without workaround under `if false`
* fix spelling
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>