Implement xwayland idle fix differently

This commit is contained in:
fwsmit 2020-12-21 19:14:13 +01:00
parent af10f6f8cd
commit 5a20d463b5
3 changed files with 6 additions and 11 deletions

View File

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

View File

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

View File

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