From b66f8f362dd0d1132640c41bdaf09177e371c748 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Mon, 5 Apr 2021 20:25:49 +0200 Subject: [PATCH] Change input.c to handle new actions --- src/input.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/input.c b/src/input.c index 1495e4d..f689696 100644 --- a/src/input.c +++ b/src/input.c @@ -1,5 +1,6 @@ #include "input.h" #include "log.h" +#include "menu.h" #include "settings.h" #include "queues.h" #include @@ -41,7 +42,12 @@ void input_handle_click(unsigned int button, bool button_down, int mouse_x, int return; } - if (act == MOUSE_DO_ACTION || act == MOUSE_CLOSE_CURRENT) { + if (act == MOUSE_CONTEXT_ALL) { + context_menu(); + continue; + } + + if (act == MOUSE_DO_ACTION || act == MOUSE_CLOSE_CURRENT || act == MOUSE_CONTEXT) { int y = settings.separator_height; struct notification *n = NULL; int first = true; @@ -59,8 +65,14 @@ void input_handle_click(unsigned int button, bool button_down, int mouse_x, int if (n) { if (act == MOUSE_CLOSE_CURRENT) { n->marked_for_closure = REASON_USER; - } else { + } else if (act == MOUSE_DO_ACTION) { notification_do_action(n); + } else { + GList *notifications = NULL; + notifications = g_list_append(notifications, n); + notification_lock(n); + + context_menu_for(notifications); } } }