Fix notification not disappearing
This commit is contained in:
parent
4a9c7693f4
commit
72ceedd4db
@ -42,8 +42,7 @@ pkg_config_packs := gio-2.0 \
|
|||||||
xext \
|
xext \
|
||||||
"xrandr >= 1.5" \
|
"xrandr >= 1.5" \
|
||||||
xscrnsaver \
|
xscrnsaver \
|
||||||
wayland-client\
|
wayland-client\
|
||||||
systemd
|
|
||||||
|
|
||||||
|
|
||||||
# dunstify also needs libnotify
|
# dunstify also needs libnotify
|
||||||
|
@ -74,10 +74,12 @@ static gboolean run(void *data)
|
|||||||
bool active = queues_length_displayed() > 0;
|
bool active = queues_length_displayed() > 0;
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
|
LOG_D("Dunst: Window is active");
|
||||||
// Call draw before showing the window to avoid flickering
|
// Call draw before showing the window to avoid flickering
|
||||||
draw();
|
draw();
|
||||||
output->win_show(win);
|
output->win_show(win);
|
||||||
} else {
|
} else {
|
||||||
|
LOG_D("Dunst: Window is NOT active");
|
||||||
output->win_hide(win);
|
output->win_hide(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +88,8 @@ static gboolean run(void *data)
|
|||||||
gint64 sleep = queues_get_next_datachange(now);
|
gint64 sleep = queues_get_next_datachange(now);
|
||||||
gint64 timeout_at = now + sleep;
|
gint64 timeout_at = now + sleep;
|
||||||
|
|
||||||
|
LOG_D("Dunst: sleeping for %li ms", sleep/1000);
|
||||||
|
|
||||||
if (sleep >= 0) {
|
if (sleep >= 0) {
|
||||||
if (next_timeout < now || timeout_at < next_timeout) {
|
if (next_timeout < now || timeout_at < next_timeout) {
|
||||||
g_timeout_add(sleep/1000, run, NULL);
|
g_timeout_add(sleep/1000, run, NULL);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "output.h"
|
#include "output.h"
|
||||||
|
|
||||||
|
#include "log.h"
|
||||||
#include "x11/x.h"
|
#include "x11/x.h"
|
||||||
#include "x11/screen.h"
|
#include "x11/screen.h"
|
||||||
#include "wayland/wl.h"
|
#include "wayland/wl.h"
|
||||||
|
16
src/queues.c
16
src/queues.c
@ -141,6 +141,7 @@ static bool queues_notification_is_finished(struct notification *n, struct dunst
|
|||||||
if (n->timeout == 0) // sticky
|
if (n->timeout == 0) // sticky
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* LOG_I("Queues: Still checking if notification is finished"); */
|
||||||
bool is_idle = status.fullscreen ? false : status.idle;
|
bool is_idle = status.fullscreen ? false : status.idle;
|
||||||
|
|
||||||
/* don't timeout when user is idle */
|
/* don't timeout when user is idle */
|
||||||
@ -311,6 +312,21 @@ void queues_notification_close_id(int id, enum reason reason)
|
|||||||
{
|
{
|
||||||
struct notification *target = NULL;
|
struct notification *target = NULL;
|
||||||
|
|
||||||
|
char* reason_string;
|
||||||
|
switch (reason)
|
||||||
|
{
|
||||||
|
case REASON_TIME:
|
||||||
|
reason_string="time";
|
||||||
|
break;
|
||||||
|
case REASON_USER:
|
||||||
|
reason_string="user";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
reason_string="unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_D("Queues: Closing notification for reason: %s", reason_string);
|
||||||
|
|
||||||
GQueue *allqueues[] = { displayed, waiting };
|
GQueue *allqueues[] = { displayed, waiting };
|
||||||
for (int i = 0; i < sizeof(allqueues)/sizeof(GQueue*); i++) {
|
for (int i = 0; i < sizeof(allqueues)/sizeof(GQueue*); i++) {
|
||||||
for (GList *iter = g_queue_peek_head_link(allqueues[i]); iter;
|
for (GList *iter = g_queue_peek_head_link(allqueues[i]); iter;
|
||||||
|
@ -777,6 +777,7 @@ void x_win_show(window winptr)
|
|||||||
*/
|
*/
|
||||||
void x_win_hide(window winptr)
|
void x_win_hide(window winptr)
|
||||||
{
|
{
|
||||||
|
LOG_I("X11: Hiding window");
|
||||||
struct window_x11 *win = (struct window_x11*)winptr;
|
struct window_x11 *win = (struct window_x11*)winptr;
|
||||||
ASSERT_OR_RET(win->visible,);
|
ASSERT_OR_RET(win->visible,);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user