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

Re: DBUS signals?


Le 27/09/2024 à 01:19, Benoît Minisini a écrit :
Le 27/09/2024 à 00:08, Jussi Lahtinen a écrit :
    I run your posted project, and I noticed that the middle click event
    was
    catched. I didn't check if this project actually uses DBusSignal.

    Anyway, you must ensure that your DBusSignal handler does not catch
    DBus
    messages that should be sent to the DBus objects created by the
    TrayIcon
    class implementation. It could explain why it does not see the DBus
    MiddleClick signal sent by the desktop!


Only middle click is send with DBus? Other buttons work.

Middle click works here with KDE, with the DBusSignal handler activated.

If I shutdown the computer while GAlarm is running, KDE tells that GAlarm has cancelled the shutdown.

I guess it's because its main window cannot be closed. And so the shutdown is canceled, and the PrepareForShutdown signal is not sent.

Regards,


I test with a little program that just created the same DBusSignal object than GAlarm, and wrote in a text file the received signals.

I run 'dbus-monitor' at the same time and redirect its output in a file.

Both for catching any signal send with the 'org.freedesktop.login1.Manager' interface.

Result: Both succeed in catching "PrepareForSleep" when sleeping. But none caught "PrepareForShutdown" or any other signal when shutting down.

Strange... Maybe the system shutdown is too fast to let 'dbus-monitor' or my little program write into its file? What's the point of this signal then, if it does not give any program enough time to do anything?

I suggest that you use only the Close event of the main form to detect that you are shutting down or logout. It's more logical, are your program cannot survive a logout anyway.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: DBUS signals?BB <adamnt42@xxxxxxxxx>
References:
DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: DBUS signals?BB <adamnt42@xxxxxxxxx>
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: DBUS signals?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: DBUS signals?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: DBUS signals?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>