Unverified Commit 653058be authored by Stian Onarheim's avatar Stian Onarheim Committed by GitHub

Close notification with middle mouse button (#413)

* Close notification with middle mouse button Signed-off-by: 's avatarStian Onarheim <stian.onarheim@protonmail.com> * Fix linting issue --------- Signed-off-by: 's avatarStian Onarheim <stian.onarheim@protonmail.com> Co-authored-by: 's avatarErik Reider <35975961+ErikReider@users.noreply.github.com>
parent 931bea27
...@@ -257,7 +257,7 @@ To reload css after changes ...@@ -257,7 +257,7 @@ To reload css after changes
- Shift+D: Toggle Do Not Disturb - Shift+D: Toggle Do Not Disturb
- Buttons 1-9: Execute alternative actions - Buttons 1-9: Execute alternative actions
- Left click button / actions: Activate notification action - Left click button / actions: Activate notification action
- Right click notification: Close notification - Middle/Right click notification: Close notification
## Configuring ## Configuring
......
...@@ -44,7 +44,7 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c ...@@ -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 *Left click button / actions*: Activate notification action
*Right click notification*: Close notification *Middle/Right click notification*: Close notification
# CONFIGURATION # CONFIGURATION
......
...@@ -206,10 +206,15 @@ namespace SwayNotificationCenter { ...@@ -206,10 +206,15 @@ namespace SwayNotificationCenter {
/// ///
this.button_press_event.connect ((event) => { this.button_press_event.connect ((event) => {
if (event.button != Gdk.BUTTON_SECONDARY) return false; // Close notification on middle and right button click
// Right click switch (event.button) {
this.close_notification (); case Gdk.BUTTON_MIDDLE:
return true; case Gdk.BUTTON_SECONDARY:
this.close_notification ();
return true;
default:
return false;
}
}); });
// Adds CSS :hover selector to EventBox // Adds CSS :hover selector to EventBox
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment