mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 01:38:02 +02:00
Implement support for buttons on notifications in Linux
This commit is contained in:
2
glfw/glfw3.h
vendored
2
glfw/glfw3.h
vendored
@@ -1316,7 +1316,7 @@ typedef struct GLFWLayerShellConfig {
|
||||
} GLFWLayerShellConfig;
|
||||
|
||||
typedef struct GLFWDBUSNotificationData {
|
||||
const char *app_name, *icon, *summary, *body, *action_name;
|
||||
const char *app_name, *icon, *summary, *body, **actions; size_t num_actions;
|
||||
int32_t timeout; uint8_t urgency; uint32_t replaces;
|
||||
} GLFWDBUSNotificationData;
|
||||
|
||||
|
||||
8
glfw/linux_notify.c
vendored
8
glfw/linux_notify.c
vendored
@@ -124,10 +124,10 @@ glfw_dbus_send_user_notification(const GLFWDBUSNotificationData *n, GLFWDBusnoti
|
||||
APPEND(args, DBUS_TYPE_STRING, n->summary)
|
||||
APPEND(args, DBUS_TYPE_STRING, n->body)
|
||||
check_call(dbus_message_iter_open_container, &args, DBUS_TYPE_ARRAY, "s", &array);
|
||||
if (n->action_name) {
|
||||
static const char* default_action = "default";
|
||||
APPEND(array, DBUS_TYPE_STRING, default_action);
|
||||
APPEND(array, DBUS_TYPE_STRING, n->action_name);
|
||||
if (n->actions) {
|
||||
for (size_t i = 0; i < n->num_actions; i++) {
|
||||
APPEND(array, DBUS_TYPE_STRING, n->actions[i]);
|
||||
}
|
||||
}
|
||||
check_call(dbus_message_iter_close_container, &args, &array);
|
||||
check_call(dbus_message_iter_open_container, &args, DBUS_TYPE_ARRAY, "{sv}", &array);
|
||||
|
||||
Reference in New Issue
Block a user