1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-04 20:21:02 +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:
Jake Stanger 2023-12-31 00:50:03 +00:00
parent b2a37a32b0
commit b4d75450ac
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
14 changed files with 27 additions and 23 deletions

View file

@ -337,7 +337,7 @@ impl Module<gtk::Box> for LauncherModule {
let mut buttons = IndexMap::<String, ItemButton>::new();
let tx = context.tx.clone();
let mut rx = context.subscribe();
let rx = context.subscribe();
glib_recv!(rx, event => {
match event {
LauncherUpdate::AddItem(item) => {
@ -428,7 +428,7 @@ impl Module<gtk::Box> for LauncherModule {
fn into_popup(
self,
controller_tx: mpsc::Sender<Self::ReceiveMessage>,
mut rx: broadcast::Receiver<Self::SendMessage>,
rx: broadcast::Receiver<Self::SendMessage>,
_info: &ModuleInfo,
) -> Option<gtk::Box> {
const MAX_WIDTH: i32 = 250;