9#if defined(__linux__) || defined(__FreeBSD__)
10#include <linux/input-event-codes.h>
12#define BTN_LEFT (0x110)
13#define BTN_RIGHT (0x111)
14#define BTN_MIDDLE (0x112)
15#define BTN_TOUCH (0x14a)
24int get_notification_clickable_height(
struct notification *n,
bool first,
bool last)
26 int notification_size = n->displayed_height;
28 notification_size +=
settings.frame_width * 2;
30 double half_separator =
settings.separator_height / 2.0;
31 notification_size +=
settings.separator_height;
33 notification_size += (
settings.frame_width - half_separator);
35 notification_size += (
settings.frame_width - half_separator);
37 return notification_size;
48 struct notification *next = iter->next ? iter->next->data : NULL;
51 int notification_size = get_notification_clickable_height(current, first, last);
53 if (y >= curr_y && y < curr_y + notification_size) {
57 curr_y += notification_size;
69 LOG_I(
"Pointer handle button %i: %i", button, button_down);
76 enum mouse_action *acts;
93 LOG_W(
"Unsupported mouse button: '%d'", button);
98 for (
int i = 0; acts[i] != MOUSE_ACTION_END; i++) {
99 enum mouse_action act = acts[i];
100 if (act == MOUSE_CLOSE_ALL) {
105 if (act == MOUSE_CONTEXT_ALL) {
110 if (act == MOUSE_DO_ACTION || act == MOUSE_CLOSE_CURRENT || act == MOUSE_REMOVE_CURRENT || act == MOUSE_CONTEXT || act == MOUSE_OPEN_URL) {
114 if (act == MOUSE_CLOSE_CURRENT) {
116 }
else if (act == MOUSE_DO_ACTION) {
118 }
else if (act == MOUSE_OPEN_URL) {
120 }
else if (act == MOUSE_REMOVE_CURRENT) {
@ REASON_USER
The user closed the notification.
Logging subsystem and helpers.
void notification_do_action(struct notification *n)
If the notification has an action named n->default_action_name or there is only one action and n->def...
void notification_open_url(struct notification *n)
If the notification has exactly one url, invoke it.
void notification_open_context_menu(struct notification *n)
Open the context menu for the notification.
GList * queues_get_displayed(void)
Receive the current list of displayed notifications.
void queues_history_push_all(void)
Push all waiting and displayed notifications to history.
Queues for history, waiting and displayed notifications.
Type definitions for settings.
guint8 marked_for_removal
If set, the notification is marked for removal in history.