tauri-apps / tao

The TAO of cross-platform windowing. A library in Rust built for Tauri.
Apache License 2.0
1.63k stars 191 forks source link

Related to the deprecation of MainContext::channel in GTK on Linux. #985

Open Zamoca42 opened 1 month ago

Zamoca42 commented 1 month ago

Is your feature request related to a problem? Please describe.

A warning is currently being issued that glib::MainContext::channel is deprecated in the Linux event loop-related code.

warning: use of deprecated associated function `gtk::glib::main_context_channel::<impl gtk::glib::MainContext>::channel`: Use an async channel, from async-channel for example, on the main context using spawn_future_local() instead
   --> src/platform_impl/linux/event_loop.rs:227:71
    |
227 |     let (window_requests_tx, window_requests_rx) = glib::MainContext::channel(Priority::default());
    |                                                                       ^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated associated function `gtk::glib::main_context_channel::<impl gtk::glib::MainContext>::channel`: Use an async channel, from async-channel for example, on the main context using spawn_future_local() instead
   --> src/platform_impl/linux/event_loop.rs:241:55
    |
241 |       let (device_tx, device_rx) = glib::MainContext::channel(glib::Priority::default());
    |                                                       ^^^^^^^

Describe the solution you'd like

We can update the currently used MainContext::channel to async_channel in event_loop.rs on Linux.

Additional context

See: https://gtk-rs.org/gtk4-rs/stable/latest/book/main_event_loop.html or https://discourse.gnome.org/t/help-required-to-migrate-from-dropped-maincontext-channel-api/20922

amrbashir commented 1 month ago

we are not using gtk4, and we don't plan to anytime soon so I think we can ignore this for the time being.