mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-02 11:11:04 +02:00
fix(regression): GTK refactor causing updates to be missed
Regression introduced by recent GTK refactor. The `glib_recv` macros previously using the passed in expression as the receiver, which was causing a new receiver to be created *every* time an event was received. This caused some peculiar behaviours where some events just never got through if sent too close to each other. This was most obvious in the `workspaces` module. Fixes #381
This commit is contained in:
parent
b2a37a32b0
commit
b4d75450ac
14 changed files with 27 additions and 23 deletions
|
@ -58,13 +58,15 @@ macro_rules! try_send {
|
|||
/// ```
|
||||
#[macro_export]
|
||||
macro_rules! glib_recv {
|
||||
($rx:expr, $val:ident => $expr:expr) => {
|
||||
($rx:expr, $val:ident => $expr:expr) => {{
|
||||
glib::spawn_future_local(async move {
|
||||
while let Ok($val) = $rx.recv().await {
|
||||
// re-delcare in case ie `context.subscribe()` is passed directly
|
||||
let mut rx = $rx;
|
||||
while let Ok($val) = rx.recv().await {
|
||||
$expr
|
||||
}
|
||||
});
|
||||
};
|
||||
}};
|
||||
}
|
||||
|
||||
/// Spawns a `GLib` future on the local thread, and calls `rx.recv()`
|
||||
|
@ -83,13 +85,15 @@ macro_rules! glib_recv {
|
|||
/// ```
|
||||
#[macro_export]
|
||||
macro_rules! glib_recv_mpsc {
|
||||
($rx:expr, $val:ident => $expr:expr) => {
|
||||
($rx:expr, $val:ident => $expr:expr) => {{
|
||||
glib::spawn_future_local(async move {
|
||||
while let Some($val) = $rx.recv().await {
|
||||
// re-delcare in case ie `context.subscribe()` is passed directly
|
||||
let mut rx = $rx;
|
||||
while let Some($val) = rx.recv().await {
|
||||
$expr
|
||||
}
|
||||
});
|
||||
};
|
||||
}};
|
||||
}
|
||||
|
||||
/// Locks a `Mutex`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue