Closed Freed-Wu closed 2 weeks ago
You can pass the flags
parameter when creating a proxy object. See https://stefano-m.github.io/lua-dbus_proxy/#Proxy:new
Probably something like:
local lgi = require("lgi")
p = require 'dbus_proxy'
proxy = p.Proxy:new(
{
bus = p.Bus.SESSION,
name = "org.freedesktop.IBus",
interface = "org.freedesktop.IBus",
path = "/org/freedesktop/IBus",
flags = lgi.Gio.DBusProxyFlags.DO_NOT_AUTO_START
}
)
How to assign bus address? I try
proxy0 = p.Proxy:new(
{
bus = p.Bus["unix:path=/home/wzy/.cache/ibus/dbus-c2RX3vlC,guid=d8c2b7e5b01276d5bcc582f666ae1289"],
name = "org.freedesktop.IBus",
interface = "org.freedesktop.IBus",
path = "/org/freedesktop/IBus",
flags = lgi.Gio.DBusProxyFlags.DO_NOT_AUTO_START
}
)
It will give me
(process:979743): GLib-GIO-CRITICAL **: 12:38:38.335: g_dbus_connection_signal_subscribe: assertion 'sender == NULL || (g_dbus_is_name (sender) && (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION))' failed
(process:979743): GLib-GIO-CRITICAL **: 12:38:38.335: g_dbus_connection_signal_subscribe: assertion 'sender == NULL || (g_dbus_is_name (sender) && (connection->flags & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION))' failed
Timeout was reached
Stack trace:
#0 [C]: in function ?
#1 [C]: in function 'error'
#2 /home/wzy/.local/share/lua/5.1/dbus_proxy/_proxy.lua:584: in function 'new'
I doubt it is because https://github.com/stefano-m/lua-dbus_proxy/blob/master/src/dbus_proxy/_bus.lua#L34 pass None to Connection Flags. https://github.com/ibus/ibus/issues/2669#issuecomment-2308008274
Change Gio.DBusConnectionFlags.NONE to Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT + Gio.DBusConnectionFlags.MESSAGE_BUS_CONNECTION can solve problem.
Hi!
Your original question was about how to add flags to a proxy object, which I showed you how to do.
I understand from your latest messages that in addition to that, you need to be able to set flags on a Bus object.
It would be best if we discussed separate topics on separate issues rather than renaming old ones.
Please create a new issue explaining with as much detail as possible:
This will help keeping issues clean and separate.
Thanks!
Comes from https://github.com/ibus/ibus/issues/2669
TIA!