Allow for multiple actions per mouse event#705
Allow for multiple actions per mouse event#705tsipinakis merged 5 commits intodunst-project:masterfrom
Conversation
The user provides a comma-separated list of valid mouse actions that will be performed one after another when a notification is clicked. If any one of the provided actions is invalid, the value reverts to its default state.
Codecov Report
@@ Coverage Diff @@
## master #705 +/- ##
==========================================
+ Coverage 66.40% 67.17% +0.77%
==========================================
Files 29 29
Lines 4899 5006 +107
==========================================
+ Hits 3253 3363 +110
+ Misses 1646 1643 -3
Continue to review full report at Codecov.
|
|
I would also like suggestions on changing the description of these options in the default |
|
But anyways, all in all the code looks nice and polished. I've seldomly seen a PR written with perfect style! Keep up the good work 👍 |
Lesson: don't reinvent the wheel. Additionally, changed a `g_malloc` call to `g_malloc_n` for safety.
|
Thanks for the encouragement! Fixes should be up. I decided to keep |
These make it more clear to the user that the mouse_click options can be defined as lists.
tsipinakis
left a comment
There was a problem hiding this comment.
As @bebehei said, it's rare to see a perfect PR from the get-go. Keep up the good work!
I think that's fine as you've put it. In my case all programs I've come across close the notification by themselves when an action is triggered, so I'd consider this the 'default behavour'. |
This PR introduces functions for parsing configuration options provided in
dunstrcor on the command line as comma-separated lists of one or more values. Elements are separated by single commas, and trailing whitespace around commas is trimmed, although whitespace in the middle of elements is preserved. Additionally, it makes use of this new parsing by changing themouse_left_click,mouse_middle_click, andmouse_right_clickoptions to be lists instead of just strings. Current config files are not broken by this. Some tests are provided, though any suggestions or improvements to better the style and code coverage of said tests is appreciated.Implements #690.