diff --git a/config.mk b/config.mk index d12ccb6..96413b3 100644 --- a/config.mk +++ b/config.mk @@ -42,8 +42,7 @@ pkg_config_packs := gio-2.0 \ xext \ "xrandr >= 1.5" \ xscrnsaver \ - wayland-client\ - systemd + wayland-client\ # dunstify also needs libnotify diff --git a/src/dunst.c b/src/dunst.c index 51bf38b..686f6af 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -74,10 +74,12 @@ static gboolean run(void *data) bool active = queues_length_displayed() > 0; if (active) { + LOG_D("Dunst: Window is active"); // Call draw before showing the window to avoid flickering draw(); output->win_show(win); } else { + LOG_D("Dunst: Window is NOT active"); output->win_hide(win); } @@ -86,6 +88,8 @@ static gboolean run(void *data) gint64 sleep = queues_get_next_datachange(now); gint64 timeout_at = now + sleep; + LOG_D("Dunst: sleeping for %li ms", sleep/1000); + if (sleep >= 0) { if (next_timeout < now || timeout_at < next_timeout) { g_timeout_add(sleep/1000, run, NULL); diff --git a/src/output.c b/src/output.c index 9817616..f261289 100644 --- a/src/output.c +++ b/src/output.c @@ -1,5 +1,6 @@ #include "output.h" +#include "log.h" #include "x11/x.h" #include "x11/screen.h" #include "wayland/wl.h" diff --git a/src/queues.c b/src/queues.c index 172e92a..59bd81a 100644 --- a/src/queues.c +++ b/src/queues.c @@ -141,6 +141,7 @@ static bool queues_notification_is_finished(struct notification *n, struct dunst if (n->timeout == 0) // sticky return false; + /* LOG_I("Queues: Still checking if notification is finished"); */ bool is_idle = status.fullscreen ? false : status.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; + 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 }; for (int i = 0; i < sizeof(allqueues)/sizeof(GQueue*); i++) { for (GList *iter = g_queue_peek_head_link(allqueues[i]); iter; diff --git a/src/x11/x.c b/src/x11/x.c index 3c5c1dd..f6fdecc 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -777,6 +777,7 @@ void x_win_show(window winptr) */ void x_win_hide(window winptr) { + LOG_I("X11: Hiding window"); struct window_x11 *win = (struct window_x11*)winptr; ASSERT_OR_RET(win->visible,);