tauri_plugin_wayland_nvidia_quirk/
lib.rs1#![deny(missing_docs)]
5
6mod status;
7
8pub use status::{Error, NotAffectedReason, SessionType, Status};
9
10#[cfg(target_os = "linux")]
11mod detect;
12#[cfg(target_os = "linux")]
13mod imp;
14
15use tauri::{
16 plugin::{Builder, TauriPlugin},
17 Runtime, WebviewWindow,
18};
19
20pub fn init<R: Runtime>() -> TauriPlugin<R> {
22 Builder::new("wayland-nvidia-quirk")
23 .setup(|_app, _api| {
24 #[cfg(target_os = "linux")]
25 imp::setup(_app);
26 Ok(())
27 })
28 .build()
29}
30
31pub fn apply<R: Runtime>(window: &WebviewWindow<R>) -> Result<(), Error> {
33 #[cfg(target_os = "linux")]
34 {
35 imp::apply(window)
36 }
37 #[cfg(not(target_os = "linux"))]
38 {
39 let _ = window;
40 Ok(())
41 }
42}
43
44pub fn status() -> Status {
46 #[cfg(target_os = "linux")]
47 {
48 imp::status()
49 }
50 #[cfg(not(target_os = "linux"))]
51 {
52 Status::NotAffected {
53 reason: NotAffectedReason::NotLinux,
54 }
55 }
56}