Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to ignore left click on a notification #471

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions man/swaync.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ config file to be able to detect config errors
default: true ++
description: If each notification should display a 'COPY \"1234\"' action

*notification-ignore-left-click* ++
type: bool ++
default: false ++
description: If notification should be closed on left click. This does not affect sliding behavior

*timeout* ++
type: integer ++
default: 10 ++
Expand Down
5 changes: 5 additions & 0 deletions src/configModel/configModel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ namespace SwayNotificationCenter {
*/
public bool notification_2fa_action { get; set; default = true; }

/**
* If notification should be closed on left click. This does not affect sliding behavior
*/
public bool notification_ignore_left_click { get; set; default = false; }

/**
* If notifications should display a text field to reply if the
* sender requests it.
Expand Down
5 changes: 5 additions & 0 deletions src/configSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
"description": "If each notification should display a 'COPY \"1234\"' action",
"default": true
},
"notification-ignore-left-click": {
"type": "boolean",
"description": "If notification should be closed on left click. This does not affect sliding behavior",
"default": false
},
"notification-inline-replies": {
"type": "boolean",
"description": "If notifications should display a text field to reply if the sender requests it. NOTE: Replying in popup notifications is only available if the compositor supports GTK Layer-Shell ON_DEMAND keyboard interactivity.",
Expand Down
2 changes: 1 addition & 1 deletion src/notification/notification.vala
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ namespace SwayNotificationCenter {
// Emit released
if (!default_action_down) return;
default_action_down = false;
if (default_action_in) {
if (default_action_in && !ConfigModel.instance.notification_ignore_left_click) {
click_default_action ();
}

Expand Down