From 756f822a6bdeaba6f93a9e72921ccadeab65ec6a Mon Sep 17 00:00:00 2001 From: fwsmit Date: Thu, 17 Dec 2020 21:20:20 +0100 Subject: [PATCH] Fix notifications not disapearing on xwayland Because idle detection on xwayland is not possible, just assume that the user is not idle. This also somehow fixes notifications not disapearing when clicking on them. --- src/output.c | 6 ++++-- src/queues.c | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/output.c b/src/output.c index de0d412..48f0782 100644 --- a/src/output.c +++ b/src/output.c @@ -5,14 +5,15 @@ #include "x11/screen.h" #include "wayland/wl.h" +bool running_xwayland; + const bool is_running_wayland(void) { char* wayland_display = getenv("WAYLAND_DISPLAY"); return !(wayland_display == NULL); } const bool is_running_xwayland(void) { - // FIXME - return false; + return running_xwayland; } const struct output output_x11 = { @@ -57,6 +58,7 @@ const struct output output_wl = { const struct output* output_create(bool force_xwayland) { + running_xwayland = force_xwayland; if (!force_xwayland && is_running_wayland()) { LOG_I("Using Wayland output"); return &output_wl; diff --git a/src/queues.c b/src/queues.c index 6892953..62313ad 100644 --- a/src/queues.c +++ b/src/queues.c @@ -143,9 +143,12 @@ static bool queues_notification_is_finished(struct notification *n, struct dunst bool is_idle = status.fullscreen ? false : status.idle; + /* There is no way to detect if the user is idle + * on xwayland, so assume they aren't */ + if (is_running_xwayland()) is_idle = false; + /* don't timeout when user is idle */ - /* NOTE: Idle is not working on xwayland */ - if (is_idle && !n->transient && !is_running_xwayland()) { + if (is_idle && !n->transient) { n->start = time_monotonic_now(); return false; }