From 5a20d463b59d5ecbacb5dce2a4d12bb8150452b4 Mon Sep 17 00:00:00 2001 From: fwsmit Date: Mon, 21 Dec 2020 19:14:13 +0100 Subject: [PATCH] Implement xwayland idle fix differently --- src/output.c | 7 ------- src/queues.c | 4 ---- src/settings.c | 6 ++++++ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/output.c b/src/output.c index 48f0782..6f6f6e6 100644 --- a/src/output.c +++ b/src/output.c @@ -5,17 +5,11 @@ #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) { - return running_xwayland; -} - const struct output output_x11 = { x_setup, x_free, @@ -58,7 +52,6 @@ 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 62313ad..e3445c5 100644 --- a/src/queues.c +++ b/src/queues.c @@ -143,10 +143,6 @@ 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 */ if (is_idle && !n->transient) { n->start = time_monotonic_now(); diff --git a/src/settings.c b/src/settings.c index 0fa140f..2d25916 100644 --- a/src/settings.c +++ b/src/settings.c @@ -215,6 +215,12 @@ void load_settings(char *cmdline_config_path) "Don't timeout notifications if user is longer idle than threshold" ); + if (settings.force_xwayland) { + /* There is no way to detect if the user is idle + * on xwayland, so turn this feature off */ + settings.idle_threshold = 0; + } + settings.monitor = option_get_int( "global", "monitor", "-mon/-monitor", defaults.monitor,