egui/crates/eframe/CHANGELOG.md
Robert Bragg fb92434aac
Android support for EFrame (#1952)
* eframe: allow hooking into EventLoop building

This enables native applications to add an `event_loop_builder` callback
to the `NativeOptions` struct that lets them modify the Winit
`EventLoopBuilder` before the final `EventLoop` is built and run.

This makes it practical for applications to change platform
specific config options that Egui doesn't need to be directly aware of.

For example the `android-activity` glue crate that supports writing
Android applications in Rust requires that the Winit event loop be
passed a reference to the `AndroidApp` that is given to the
`android_main` entrypoint for the application.

Since the `AndroidApp` itself is abstracted by Winit then there's no
real need for Egui/EFrame to have a dependency on the `android-activity`
crate just for the sake of associating this state with the event loop.

Addresses: #1951

* eframe: defer graphics state initialization until app Resumed

Conceptually the Winit `Resumed` event signifies that the application is
ready to run and render and since
https://github.com/rust-windowing/winit/pull/2331 all platforms now
consistently emit a Resumed event that can be used to initialize
graphics state for an application.

On Android in particular it's important to wait until the application
has Resumed before initializing graphics state since it won't have an
associated SurfaceView while paused.

Without this change then Android applications are likely to just show
a black screen.

This updates the Wgpu+Winit and Glow+Winit integration for eframe but
it's worth noting that the Glow integration is still not able to fully
support suspend and resume on Android due to limitations with Glutin's
API that mean we can't destroy and create a Window without also
destroying the GL context, and therefore (practically) the entire
application.

There is a plan (and progress on) to improve the Glutin API here:
https://github.com/rust-windowing/glutin/pull/1435 and with that change
it should be an incremental change to enable Android suspend/resume
support with Glow later.

In the mean time the Glow changes keep the implementation consistent
with the wgpu integration and it should now at least be possible to
start an Android application - even though it won't be able to suspend
correctly.

Fixes #1951
2022-08-23 14:43:22 +02:00

10 KiB

Changelog for eframe

All notable changes to the eframe crate.

NOTE: egui-winit, egui_glium, egui_glow,and egui-wgpu have their own changelogs!

Unreleased

  • Added NativeOptions::event_loop_builder hook for apps to change platform specific event loop options (#1952).
  • Enabled deferred render state initialization to support Android (#1952).

0.19.0 - 2022-08-20

  • MSRV (Minimum Supported Rust Version) is now 1.61.0 (#1846).
  • Added wgpu rendering backed (#1564):
    • Added features wgpu and glow.
    • Added NativeOptions::renderer to switch between the rendering backends.
  • egui_glow: remove calls to gl.get_error in release builds to speed up rendering (#1583).
  • Added App::post_rendering for e.g. reading the framebuffer (#1591).
  • Use Arc for glow::Context instead of Rc (#1640).
  • Fixed bug where the result returned from App::on_exit_event would sometimes be ignored (#1696).
  • Added NativeOptions::follow_system_theme and NativeOptions::default_theme (#1726).
  • Selectively expose parts of the API based on target arch (wasm32 or not) (#1867).

Desktop/Native:

  • Fixed clipboard on Wayland (#1613).
  • Added ability to read window position and size with frame.info().window_info (#1617).
  • Allow running on native without hardware accelerated rendering. Change with NativeOptions::hardware_acceleration (#1681, #1693).
  • Fixed window position persistence (#1745).
  • Fixed mouse cursor change on Linux (#1747).
  • Added Frame::set_visible (#1808).
  • Added fullscreen support (#1866).
  • You can now continue execution after closing the native desktop window (#1889).
  • Frame::quit has been renamed to Frame::close and App::on_exit_event is now App::on_close_event (#1943).

Web:

  • Added ability to stop/re-run web app from JavaScript. ⚠️ You need to update your CSS with html, body: { height: 100%; width: 100%; } (#1803).
  • Added WebOptions::follow_system_theme and WebOptions::default_theme (#1726).
  • Added option to select WebGL version (#1803).

0.18.0 - 2022-04-30

  • MSRV (Minimum Supported Rust Version) is now 1.60.0 (#1467).
  • Removed eframe::epi - everything is now in eframe (eframe::App, eframe::Frame etc) (#1545).
  • Removed Frame::request_repaint - just call egui::Context::request_repaint for the same effect (#1366).
  • Changed app creation/setup (#1363):
    • Removed App::setup and App::name.
    • Provide CreationContext when creating app with egui context, storage, integration info and glow context.
    • Change interface of run_native and start_web.
  • Added Frame::storage() and Frame::storage_mut() (#1418).
    • You can now load/save state in App::update
    • Changed App::update to take &mut Frame instead of &Frame.
    • Frame is no longer Clone or Sync.
  • Added glow (OpenGL) context to Frame (#1425).

Desktop/Native:

  • Remove the egui_glium feature. eframe will now always use egui_glow as the native backend (#1357).
  • Change default for NativeOptions::drag_and_drop_support to true (#1329).
  • Added new NativeOptions: vsync, multisampling, depth_buffer, stencil_buffer.
  • dark-light (dark mode detection) is now an opt-in feature (#1437).
  • Fixed potential scale bug when DPI scaling changes (e.g. when dragging a window between different displays) (#1441).
  • Added new feature puffin to add puffin profiler scopes (#1483).
  • Moved app persistence to a background thread, allowing for smoother frame rates (on native).
  • Added Frame::set_window_pos (#1505).

Web:

  • Use full browser width by default (#1378).
  • egui code will no longer be called after panic (#1306).

0.17.0 - 2022-02-22

  • Removed Frame::alloc_texture. Use egui::Context::load_texture instead (#1110).
  • Shift-scroll will now result in horizontal scrolling on all platforms (#1136).
  • Log using the tracing crate. Log to stdout by adding tracing_subscriber::fmt::init(); to your main (#1192).

Desktop/Native:

  • The default native backend is now egui_glow (instead of egui_glium) (#1020).
  • Automatically detect and apply dark or light mode from system (#1045).
  • Fixed horizontal scrolling direction on Linux.
  • Added App::on_exit_event (#1038)
  • Added NativeOptions::initial_window_pos.
  • Fixed enable_drag for Windows OS (#1108).

Web:

  • The default web painter is now egui_glow (instead of WebGL) (#1020).
  • Fixed glow failure on Chromium (#1092).
  • Updated eframe::IntegrationInfo::web_location_hash on hashchange event (#1140).
  • Expose all parts of the location/url in frame.info().web_info (#1258).

0.16.0 - 2021-12-29

  • Frame can now be cloned, saved, and passed to background threads (#999).
  • Added Frame::request_repaint to replace repaint_signal (#999).
  • Added Frame::alloc_texture/free_texture to replace tex_allocator (#999).

Web:

0.15.0 - 2021-10-24

  • Frame now provides set_window_title to set window title dynamically
  • Frame now provides set_decorations to set whether to show window decorations.
  • Remove "http" feature (use https://github.com/emilk/ehttp instead!).
  • Added App::persist_native_window and App::persist_egui_memory to control what gets persisted.

Desktop/Native:

  • Increase native scroll speed.
  • Added new backend egui_glow as an alternative to egui_glium. Enable with default-features = false, features = ["default_fonts", "egui_glow"].

Web:

  • Implement eframe::NativeTexture trait for the WebGL painter.
  • Deprecate `Painter::register_webgl_texture.
  • Fixed multiline paste.
  • Fixed painting with non-opaque backgrounds.
  • Improve text input on mobile and for IME.

0.14.0 - 2021-08-24

  • Added dragging and dropping files into egui.
  • Improve http fetch API.
  • run_native now returns when the app is closed.
  • Web: Made text thicker and less pixelated.

0.13.1 - 2021-06-24

  • Fixed http feature flag and docs

0.13.0 - 2021-06-24

  • App::setup now takes a Frame and Storage by argument.
  • App::load has been removed. Implement App::setup instead.
  • Web: Default to light visuals unless the system reports a preference for dark mode.
  • Web: Improve alpha blending, making fonts look much better (especially in light mode)
  • Web: Fix double-paste bug

0.12.0 - 2021-05-10

  • Moved options out of trait App into new NativeOptions.
  • Added option for always_on_top.
  • Web: Scroll faster when scrolling with mouse wheel.

0.11.0 - 2021-04-05

  • You can now turn your window transparent with the App::transparent option.
  • You can now disable window decorations with the App::decorated option.
  • Web: Fix mobile and IME text input
  • Web: Hold down a modifier key when clicking a link to open it in a new tab.

Contributors: n2

0.10.0 - 2021-02-28

  • You can now set your own app icons.
  • You can control the initial size of the native window with App::initial_window_size.
  • You can control the maximum egui web canvas size with App::max_size_points.
  • Frame::tex_allocator() no longer returns an Option (there is always a texture allocator).

0.9.0 - 2021-02-07

  • Added support for HTTP body.
  • Web: Right-clicks will no longer open browser context menu.
  • Web: Fix a bug where one couldn't select items in a combo box on a touch screen.

0.8.0 - 2021-01-17

  • Simplify TextureAllocator interface.
  • WebGL2 is now supported, with improved texture sampler. WebGL1 will be used as a fallback.
  • Web: Slightly improved alpha-blending (work-around for non-existing linear-space blending).
  • Web: Call prevent_default for arrow keys when entering text

0.7.0 - 2021-01-04

  • Initial release of eframe