You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 inwaiting
queue until the normal notifications timed out. Then the noficiation gets shown.reproducing
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
anddisplayed
together. Add anothergint64 last_shown
field in notification struct and then add inqueues.c
a new function forGSList *get_displayed(gint64 lastshown, uint size)
.It returns the first
size
notifications ofdisplayed
. Ifn->last_shown != lastshown
(-> not shown before) it does equivalent things to notification as previously moving fromwaiting
todisplayed
and also it know, if it has ever shown before (n->start == 0
)Of course,
notification_cmp_data
should handleredisplayed
here, too.Solution2
Enhance the waiting insertion process: Make a shallow copy of
displayed
first (call itdisplayed'
). Then insert sorted the nofication todisplayed'
. Check ifdisplayed'->tail->data == notification
and if so, push it towaiting
or remove the last element fromdisplayed
and push then the new notification into it.The text was updated successfully, but these errors were encountered: