[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DBUS signals?


Shutdown signal and inhibit is managed by the desktop.
Many use different types.
On gnome2 (mate cinnamon) the
Gnome session manager works.

Here's how I use in my IDE.
An inhibit is created when a file is modified and released when saved so I
can't shutdown if an unsaved modified file is open.
https://gitlab.com/bsteers4/gambas/-/blob/bruces-patched/app/src/gambas3/.src/Util/Inhibitor.class

I could not figure out any other methods.

On most systems the generic way seems to be swallowed by the desktops way
of doing it.

Plus Gambas dbus cannot seem to do file descriptors the way dbus wants them.
Benoit has tried to get this working but it's deep.

On Thu, 26 Sept 2024, 00:26 Jussi Lahtinen, <jussi.lahtinen@xxxxxxxxx>
wrote:

> You'll need to tell it the object and the signal-name and set "every" to
>> true in the "new" parameter.
>>
> No, the signals have no destination, they are already for everyone. Also
> I'm not waiting for an object and the signal name is given in the event.
> See DBusSignal.
>
>
>> I'd give you better details but my system doesn't use Hal.Manager
>>
>> The IDE gives some dbus introspection in the bottom tabs (I forget
>> where).
>> qDBusViewer (available on your distro?) is a good utility to look at what
>> DBus is happening on your system.
>>
>> Signals are possibly the hardest way to learn about the dbus component
>> and dbus in general.
>>
>
> I did this:
> $ dbus-monitor --system >> signals.txt
>
> And immediately shutdown my computer. I got 1.1 MB of shit... oh wow. But
> there is also the PrepareForShutdown signal, but I cannot see that in
> Gambas.
> "signal time=1727305608.503257 sender=:1.11 -> destination=(null
> destination) serial=109 path=/org/freedesktop/login1;
> interface=org.freedesktop.login1.Manager; member=PrepareForShutdown"
>
> Benoit, any reason why this is missing? Is something related to DBus
> closed already..?
> Is there another Qt/GTK independent way to detect shutdown?
>
>
> Jussi
>
>

References:
DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: DBUS signals?BB <adamnt42@xxxxxxxxx>
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>