diff --git a/README.md b/README.md index 5986194f..1dfded74 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ To reload css after changes - Shift+D: Toggle Do Not Disturb - Buttons 1-9: Execute alternative actions - Left click button / actions: Activate notification action -- Right click notification: Close notification +- Middle/Right click notification: Close notification ## Configuring diff --git a/man/swaync.1.scd b/man/swaync.1.scd index a5140de1..2d32832a 100644 --- a/man/swaync.1.scd +++ b/man/swaync.1.scd @@ -44,7 +44,7 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c *Left click button / actions*: Activate notification action -*Right click notification*: Close notification +*Middle/Right click notification*: Close notification # CONFIGURATION diff --git a/src/notification/notification.vala b/src/notification/notification.vala index 9f8c5a3f..bb3bffce 100644 --- a/src/notification/notification.vala +++ b/src/notification/notification.vala @@ -206,10 +206,15 @@ namespace SwayNotificationCenter { /// this.button_press_event.connect ((event) => { - if (event.button != Gdk.BUTTON_SECONDARY) return false; - // Right click - this.close_notification (); - return true; + // Close notification on middle and right button click + switch (event.button) { + case Gdk.BUTTON_MIDDLE: + case Gdk.BUTTON_SECONDARY: + this.close_notification (); + return true; + default: + return false; + } }); // Adds CSS :hover selector to EventBox