#windowing

tao

Cross-platform window manager library

39 releases (12 breaking)

Uses new Rust 2021

new 0.13.3 Aug 14, 2022
0.13.1 Jul 29, 2022
0.7.0 Mar 28, 2022
0.5.2 Aug 12, 2021
0.4.0 Jul 14, 2021

#29 in GUI

Download history 5655/week @ 2022-04-25 7510/week @ 2022-05-02 7222/week @ 2022-05-09 7694/week @ 2022-05-16 6985/week @ 2022-05-23 5765/week @ 2022-05-30 6657/week @ 2022-06-06 9675/week @ 2022-06-13 9746/week @ 2022-06-20 8613/week @ 2022-06-27 8715/week @ 2022-07-04 8544/week @ 2022-07-11 8913/week @ 2022-07-18 9089/week @ 2022-07-25 9690/week @ 2022-08-01 7382/week @ 2022-08-08

36,088 downloads per month
Used in 26 crates (6 directly)

Apache-2.0

2.5MB
27K SLoC

TAO - Window Creation Library

License Chat Server website https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg support

Cross-platform application window creation library in Rust that supports all major platforms like Windows, macOS, Linux, iOS and Android. Built for you, maintained for Tauri.

Cargo Features

TAO provides the following features, which can be enabled in your Cargo.toml file:

  • serde: Enables serialization/deserialization of certain types with Serde.
  • tray: Enables system tray and more menu item variants on Linux. This feature requires either libayatana-appindicator or libappindicator package installed. You can still create those types if you disable it. They just don't create the actual objects. We set this flag because some implementations require more installed packages.

Platform-specific notes

Android

This library makes use of the ndk-rs crates, refer to that repo for more documentation.

Running on an Android device needs a dynamic system library, add this to Cargo.toml:

[[example]]
name = "request_redraw_threaded"
crate-type = ["cdylib"]

And add this to the example file to add the native activity glue:

#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))]
fn main() {
    ...
}

And run the application with cargo apk run --example request_redraw_threaded

Linux

Gtk and its related libraries are used to build the support of Linux. Be sure to install following packages before building:

Arch Linux / Manjaro:

sudo pacman -S gtk3

For tray feature:

sudo pacman -S libappindicator-gtk3

Debian / Ubuntu:

sudo apt install libgtk-3-dev

For tray feature, choose one of following pachages:

sudo apt install libappindicator3-dev
sudo apt install libayatana-appindicator3-dev

macOS

To ensure compatibility with older macOS systems, TAO links to CGDisplayCreateUUIDFromDisplayID through the CoreGraphics framework. However, under certain setups this function is only available to be linked through the newer ColorSync framework. So, TAO provides the TAO_LINK_COLORSYNC environment variable which can be set to 1 or true while compiling to enable linking via ColorSync.

Acknowledgement

This is a fork of winit which replaces Linux's port to Gtk. We need it not only because of webkit2gtk, but also a lot of Desktop Environment features like menu bar, system tray, global shortcuts etc. In the future, we want to make these features more modular as separate crates. So we can switch back to winit and also benefit the whole community.

Dependencies

~0.3–61MB
~1M SLoC