Implement xwayland idle fix differently
This commit is contained in:
parent
af10f6f8cd
commit
5a20d463b5
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user