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

Queue handling with settings.sort #431

Closed
bebehei opened this issue Nov 5, 2017 · 0 comments
Closed

Queue handling with settings.sort #431

bebehei opened this issue Nov 5, 2017 · 0 comments
Labels
Milestone

Comments

@bebehei
Copy link
Member

bebehei commented Nov 5, 2017

I looked today at #301. On the first sight, the fix seems to be easy (just inserting it at top from display). But I found some other issues:

When notifications get sorted, the a full displayed queue overruns urgent notifications and lets them stay in waiting queue until the normal notifications timed out. Then the noficiation gets shown.

reproducing

for i in {0..5}; do notify-send a $i; done
notify-send -u critical a b

The notification "a b" will get shown after all notifications have timed out. "a {1...5}" have timed out.

Solutions

None of my thoughts are satisfying yet.

Solution1

Merge waiting and displayed together. Add another gint64 last_shown field in notification struct and then add in queues.c a new function for GSList *get_displayed(gint64 lastshown, uint size).

It returns the first size notifications of displayed. If n->last_shown != lastshown (-> not shown before) it does equivalent things to notification as previously moving from waiting to displayed and also it know, if it has ever shown before (n->start == 0)

Of course, notification_cmp_data should handle redisplayed here, too.

Solution2

Enhance the waiting insertion process: Make a shallow copy of displayed first (call it displayed'). Then insert sorted the nofication to displayed'. Check if displayed'->tail->data == notification and if so, push it to waiting or remove the last element from displayed and push then the new notification into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant