Aylur / ags

A customizable and extensible shell
GNU General Public License v3.0
1.75k stars 94 forks source link

bluetooth does not work properly after waking up from suspend #362

Open genericCandy opened 3 months ago

genericCandy commented 3 months ago

When I wake my laptop (Arch, ags 1.8.0) from systemctl suspend, the bluetooth service does not work properly, and I have to restart ags.

Steps to reproduce:

Expected behavior: The value of the label is updated

Actual behavior: The value of the label is not updated (it looks like the widget does not receive a signal)

config.js:

const bluetooth = await Service.import('bluetooth')

const bluetooth_hook = Widget.Label().hook(bluetooth, self => {
    // print(Utils.exec('date'))
    // print(JSON.stringify(bluetooth.connected_devices))
    // print("\n")
    self.label = `${bluetooth.connected_devices.length}`
})

App.config({
    windows: [
        Widget.Window({
            name: "test",
            anchor: ['top'],
            exclusivity: 'exclusive',
            child: bluetooth_hook,
        }),
    ]
})
genericCandy commented 3 months ago

Even replacing the label by a button (and getting the connected devices on click) doesn't work, and since bluetooth.getDevice(...)._device also says that the device isn't connected (it is), i think it may be a GJS issue (not quite sure so i'm leaving this open)

Though it surprises me that i could not find any occurrence of this issue online, so it may be only on my machine

genericCandy commented 2 months ago

After reinstalling Arch, the issue still persists (i hoped that something messed with gjs / a dependency and that reinstalling could fix it, but nope).

At this point, there's not much i think i can do (I tried reproducing with only gjs, but i don't know it much (nor do i know much javascript)), so i will leave this open :(