Set dmps off

parent 1c223d1c
...@@ -3370,7 +3370,7 @@ class QtVideoPlayer(QObject): ...@@ -3370,7 +3370,7 @@ class QtVideoPlayer(QObject):
logger.error(f"Failed to force window display: {e}") logger.error(f"Failed to force window display: {e}")
def _configure_linux_system(self): def _configure_linux_system(self):
"""Configure Linux-specific system settings - TEMPORARILY DISABLED FOR TESTING""" """Configure Linux-specific system settings"""
import platform import platform
import os import os
...@@ -3405,6 +3405,28 @@ class QtVideoPlayer(QObject): ...@@ -3405,6 +3405,28 @@ class QtVideoPlayer(QObject):
if not os.environ.get('DISPLAY'): if not os.environ.get('DISPLAY'):
logger.warning("No DISPLAY environment variable - may be running headless") logger.warning("No DISPLAY environment variable - may be running headless")
os.environ['QT_QPA_PLATFORM'] = 'offscreen' os.environ['QT_QPA_PLATFORM'] = 'offscreen'
else:
# Disable screensaver and DPMS to keep display always on
try:
import subprocess
logger.info("Disabling screensaver and DPMS to keep display always on")
# Disable screensaver
result_s = subprocess.run(['xset', 's', 'off'], capture_output=True, text=True, timeout=5)
if result_s.returncode == 0:
logger.info("Screensaver disabled successfully")
else:
logger.warning(f"Failed to disable screensaver: {result_s.stderr}")
# Disable DPMS (Display Power Management Signaling)
result_dpms = subprocess.run(['xset', '-dpms'], capture_output=True, text=True, timeout=5)
if result_dpms.returncode == 0:
logger.info("DPMS disabled successfully")
else:
logger.warning(f"Failed to disable DPMS: {result_dpms.stderr}")
except (subprocess.TimeoutExpired, subprocess.SubprocessError, FileNotFoundError) as e:
logger.warning(f"Could not disable screensaver/DPMS (xset not available or failed): {e}")
except Exception as e: except Exception as e:
logger.warning(f"Linux system configuration warning: {e}") logger.warning(f"Linux system configuration warning: {e}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment