dunst icon indicating copy to clipboard operation
dunst copied to clipboard

Add MOUSE_CLEAR_CURRENT action

Open ORDL-AMF opened this issue 9 months ago • 5 comments

Title: Add MOUSE_CLEAR_CURRENT Action to Close Notification Under Cursor

Description: Introduces a new mouse action, MOUSE_CLEAR_CURRENT, allowing users to close the notification under the mouse cursor with a left-click or desired by editing 'dunstrc' file. This removes the notification from history by id. This enhances user control over notifications.

Changes

  • src/settings.h: Added MOUSE_CLEAR_CURRENT to enum mouse_action.
  • src/settings_data.h: Added clear_current | MOUSE_CLEAR_CURRENT.
  • src/input.c: Implemented in input_handle_click to close the notification, remove it from history, and redraw.

Details

  • Closes notification with REASON_USER.
  • Uses a static dunst_status to reset fullscreen/pause/idle states.
  • Compatible with X11 and Wayland.
  • Triggers redraw via wake_up even if no notification is found.

Testing

  • Verified on X11 and Wayland simulators; works as intended.
  • No conflicts with existing functionality across 65 files.

Feedback welcome!

ORDL-AMF avatar Mar 25 '25 11:03 ORDL-AMF

hello. is the difference with close_current that the notification is erased from history? it might be good to add it to the description

bynect avatar Mar 25 '25 13:03 bynect

hello. is the difference with close_current that the notification is erased from history? it might be good to add it to the description

Yes, it removes the selected notification from history.

ORDL-AMF avatar Mar 25 '25 16:03 ORDL-AMF

please fix the build problems

bynect avatar Mar 30 '25 19:03 bynect

Sorry, I'll have the updated version up this weekend!

ORDL-AMF avatar Apr 04 '25 13:04 ORDL-AMF

any news?

bynect avatar May 05 '25 20:05 bynect

superseded by #1491

bynect avatar Aug 04 '25 13:08 bynect