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.
This commit is contained in:
fwsmit 2020-12-17 21:20:20 +01:00
parent ae38efedbb
commit 756f822a6b
2 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}