Forgot to dispatch events on the dbus session bus
This commit is contained in:
parent
1f597fd2b3
commit
cffaa54a78
5
glfw/dbus_glfw.c
vendored
5
glfw/dbus_glfw.c
vendored
@ -172,6 +172,11 @@ glfw_dbus_dispatch(DBusConnection *conn) {
|
|||||||
while(dbus_connection_dispatch(conn) == DBUS_DISPATCH_DATA_REMAINS);
|
while(dbus_connection_dispatch(conn) == DBUS_DISPATCH_DATA_REMAINS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
glfw_dbus_session_bus_dispatch() {
|
||||||
|
if (session_bus) glfw_dbus_dispatch(session_bus);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
glfw_dbus_terminate(_GLFWDBUSData *dbus) {
|
glfw_dbus_terminate(_GLFWDBUSData *dbus) {
|
||||||
if (dbus_data) {
|
if (dbus_data) {
|
||||||
|
|||||||
1
glfw/dbus_glfw.h
vendored
1
glfw/dbus_glfw.h
vendored
@ -48,6 +48,7 @@ glfw_dbus_call_method_no_reply(DBusConnection *conn, const char *node, const cha
|
|||||||
GLFWbool
|
GLFWbool
|
||||||
glfw_dbus_call_method_with_reply(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, int timeout_ms, dbus_pending_callback callback, void *user_data, ...);
|
glfw_dbus_call_method_with_reply(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, int timeout_ms, dbus_pending_callback callback, void *user_data, ...);
|
||||||
void glfw_dbus_dispatch(DBusConnection *);
|
void glfw_dbus_dispatch(DBusConnection *);
|
||||||
|
void glfw_dbus_session_bus_dispatch();
|
||||||
GLFWbool glfw_dbus_get_args(DBusMessage *msg, const char *failmsg, ...);
|
GLFWbool glfw_dbus_get_args(DBusMessage *msg, const char *failmsg, ...);
|
||||||
int glfw_dbus_match_signal(DBusMessage *msg, const char *interface, ...);
|
int glfw_dbus_match_signal(DBusMessage *msg, const char *interface, ...);
|
||||||
DBusConnection* glfw_dbus_session_bus();
|
DBusConnection* glfw_dbus_session_bus();
|
||||||
|
|||||||
31
glfw/linux_notify.c
vendored
31
glfw/linux_notify.c
vendored
@ -43,22 +43,18 @@ notification_created(DBusMessage *msg, const char* errmsg, void *data) {
|
|||||||
static DBusHandlerResult
|
static DBusHandlerResult
|
||||||
message_handler(DBusConnection *conn, DBusMessage *msg, void *user_data) {
|
message_handler(DBusConnection *conn, DBusMessage *msg, void *user_data) {
|
||||||
(void)(user_data);
|
(void)(user_data);
|
||||||
switch(glfw_dbus_match_signal(msg, NOTIFICATIONS_IFACE, "ActionInvoked", NULL)) {
|
/* printf("session_bus message_handler invoked interface: %s member: %s\n", dbus_message_get_interface(msg), dbus_message_get_member(msg)); */
|
||||||
case 0:
|
if (dbus_message_is_signal(msg, NOTIFICATIONS_IFACE, "ActionInvoked")) {
|
||||||
{
|
uint32_t notification_id;
|
||||||
uint32_t notification_id;
|
const char *action;
|
||||||
const char *action;
|
if (!glfw_dbus_get_args(msg, "Failed to get args from ActionInvoked notification signal",
|
||||||
if (glfw_dbus_get_args(msg, "Failed to get args from ActionInvoked notification signal",
|
DBUS_TYPE_UINT32, ¬ification_id, DBUS_TYPE_STRING, &action, DBUS_TYPE_INVALID)) {
|
||||||
DBUS_TYPE_UINT32, ¬ification_id, DBUS_TYPE_STRING, &action, DBUS_TYPE_INVALID)) {
|
if (activated_handler) {
|
||||||
if (activated_handler) {
|
activated_handler(notification_id, action);
|
||||||
activated_handler(notification_id, action);
|
return DBUS_HANDLER_RESULT_HANDLED;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||||
}
|
}
|
||||||
@ -69,9 +65,8 @@ glfw_dbus_send_user_notification(const char *app_name, const char* icon, const c
|
|||||||
static DBusConnection *added_signal_match = NULL;
|
static DBusConnection *added_signal_match = NULL;
|
||||||
if (!session_bus) return 0;
|
if (!session_bus) return 0;
|
||||||
if (added_signal_match != session_bus) {
|
if (added_signal_match != session_bus) {
|
||||||
dbus_bus_add_match(session_bus, "type='signal',interface='org.freedesktop.Notifications'", NULL);
|
dbus_bus_add_match(session_bus, "type='signal',interface='" NOTIFICATIONS_IFACE "',member='ActionInvoked'", NULL);
|
||||||
static DBusObjectPathVTable vtable = {.message_function = message_handler};
|
dbus_connection_add_filter(session_bus, message_handler, NULL, NULL);
|
||||||
dbus_connection_try_register_object_path(session_bus, NOTIFICATIONS_PATH, &vtable, NULL, NULL);
|
|
||||||
added_signal_match = session_bus;
|
added_signal_match = session_bus;
|
||||||
}
|
}
|
||||||
NotificationCreatedData *data = malloc(sizeof(NotificationCreatedData));
|
NotificationCreatedData *data = malloc(sizeof(NotificationCreatedData));
|
||||||
|
|||||||
1
glfw/wl_window.c
vendored
1
glfw/wl_window.c
vendored
@ -839,6 +839,7 @@ handleEvents(double timeout)
|
|||||||
wl_display_cancel_read(display);
|
wl_display_cancel_read(display);
|
||||||
}
|
}
|
||||||
glfw_ibus_dispatch(&_glfw.wl.xkb.ibus);
|
glfw_ibus_dispatch(&_glfw.wl.xkb.ibus);
|
||||||
|
glfw_dbus_session_bus_dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translates a GLFW standard cursor to a theme cursor name
|
// Translates a GLFW standard cursor to a theme cursor name
|
||||||
|
|||||||
1
glfw/x11_window.c
vendored
1
glfw/x11_window.c
vendored
@ -62,6 +62,7 @@ handleEvents(double timeout) {
|
|||||||
int display_read_ok = pollForEvents(&_glfw.x11.eventLoopData, timeout);
|
int display_read_ok = pollForEvents(&_glfw.x11.eventLoopData, timeout);
|
||||||
if (display_read_ok) _glfwDispatchX11Events();
|
if (display_read_ok) _glfwDispatchX11Events();
|
||||||
glfw_ibus_dispatch(&_glfw.x11.xkb.ibus);
|
glfw_ibus_dispatch(&_glfw.x11.xkb.ibus);
|
||||||
|
glfw_dbus_session_bus_dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLFWbool
|
static GLFWbool
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user