Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:Rebuild
profanity
profanity-0.14.0-xscreensaver.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File profanity-0.14.0-xscreensaver.patch of Package profanity
From 2ed6211cc3a93e8605c008ad944ad24ec6910838 Mon Sep 17 00:00:00 2001 From: Martin Dosch <martin@mdosch.de> Date: Fri, 11 Aug 2023 13:04:08 +0200 Subject: [PATCH] Don't use xscreensaver on wayland. Fixes #1874. --- src/ui/core.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) Index: profanity-0.14.0/src/ui/core.c =================================================================== --- profanity-0.14.0.orig/src/ui/core.c +++ profanity-0.14.0/src/ui/core.c @@ -107,7 +107,11 @@ ui_init(void) notifier_initialise(); cons_about(); #ifdef HAVE_LIBXSS - display = XOpenDisplay(0); + char* x11_display = getenv("DISPLAY"); + char* wayland_display = getenv("WAYLAND_DISPLAY"); + if (x11_display && !wayland_display) { + display = XOpenDisplay(0); + } #endif ui_idle_time = g_timer_new(); inp_size = 0; @@ -150,15 +154,17 @@ ui_get_idle_time(void) { // if compiled with libxss, get the x sessions idle time #ifdef HAVE_LIBXSS - XScreenSaverInfo* info = XScreenSaverAllocInfo(); - if (info && display) { - XScreenSaverQueryInfo(display, DefaultRootWindow(display), info); - unsigned long result = info->idle; - XFree(info); - return result; - } - if (info) { - XFree(info); + if (display) { + XScreenSaverInfo* info = XScreenSaverAllocInfo(); + if (info && display) { + XScreenSaverQueryInfo(display, DefaultRootWindow(display), info); + unsigned long result = info->idle; + XFree(info); + return result; + } + if (info) { + XFree(info); + } } // if no libxss or xss idle time failed, use profanity idle time #endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor