在 gnome 3 上重新啟用螢幕消隱

在 gnome 3 上重新啟用螢幕消隱

運行 Gnome 3.28。我遇到螢幕消隱問題。更具體地說,螢幕沒有消隱,我不知道如何讓它持續消隱。 (幾年前的某個時候,我完全取消了螢幕消隱,並且不再知道我是如何做到的。)在整個過程中,當我提到消隱時,我特別想要/更喜歡DPMS關閉行為。

在 gnome-preferences 的「Power」部分中設定「Blank Screen」沒有任何作用。 xset q返回以下內容:

DPMS (Energy Star):
  Standby: 0    Suspend: 0    Off: 0
  DPMS is Enabled
  Monitor is On

我可以使用 開啟螢幕消隱xset dpms 1200 2400 4800。這有效。但是,執行任何使用 dbus 請求禁止螢幕消隱的應用程式(例如 chrome 中的 Youtube)會導致 gnome 電源設定守護程式將這些值設定回零,並且永遠不會將它們設定回零。

追蹤正在發生的事情,例如啟動 Youtube,inhibit向 SessionManager 發送請求:

method call time=1533650079.657788 sender=:1.1216 -> destination=org.gnome.SessionManager serial=3 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Inhibit
   string "/usr/bin/google-chrome-stable"
   uint32 0
   string "Playing video"
   uint32 12
signal time=1533650079.659445 sender=:1.14 -> destination=(null destination) serial=10679 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=InhibitorAdded
   object path "/org/gnome/SessionManager/Inhibitor975"
method return time=1533650079.659468 sender=:1.14 -> destination=:1.1216 serial=10680 reply_serial=3
   uint32 754926118
signal time=1533650079.659475 sender=:1.14 -> destination=(null destination) serial=10681 path=/org/gnome/SessionManager; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.SessionManager"
   array [
      dict entry(
         string "InhibitedActions"
         variant             uint32 12
      )
   ]
   array [
   ]

這會導致gsd-power守護程式要求 mutter 關閉省電模式:

method call time=1533650079.666562 sender=:1.36 -> destination=:1.16 serial=182 path=/org/gnome/Mutter/DisplayConfig; interface=org.freedesktop.DBus.Properties; member=Set
   string "org.gnome.Mutter.DisplayConfig"
   string "PowerSaveMode"
   variant       int32 0

這有效,將 DPMS 設為零。當我關閉 YouTube 會話時,我收到一個符合的取消禁止請求:

method call time=1533650081.283611 sender=:1.1216 -> destination=org.gnome.SessionManager serial=4 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=Uninhibit
   uint32 754926118
signal time=1533650081.286730 sender=:1.14 -> destination=(null destination) serial=10690 path=/org/gnome/SessionManager; interface=org.gnome.SessionManager; member=InhibitorRemoved
   object path "/org/gnome/SessionManager/Inhibitor975"
method call time=1533650081.286768 sender=:1.14 -> destination=org.freedesktop.DBus serial=10691 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus',arg0=':1.1216'"
method return time=1533650081.286778 sender=org.freedesktop.DBus -> destination=:1.14 serial=3032 reply_serial=10691
method return time=1533650081.286784 sender=:1.14 -> destination=:1.1216 serial=10692 reply_serial=4
signal time=1533650081.286789 sender=:1.14 -> destination=(null destination) serial=10693 path=/org/gnome/SessionManager; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.gnome.SessionManager"
   array [
      dict entry(
         string "InhibitedActions"
         variant             uint32 4
      )
   ]
   array [
   ]

但沒有任何東西告訴穆特重新開啟省電模式。通常應該做什麼,以及什麼可能阻止它這樣做?

答案1

你有沒有打開gdm,因為如果沒有鎖定螢幕,就不會有任何變暗。

問題是 gdm 正在將 org.gnome.SessionManager.Presence 讀取為先前的 gnome-scrennsaver,因此向 mutter 發送訊息是假的,因為重置計時器應該只執行一次。

調光是透過發送 dpms 強制關閉或不依賴 dpms 計時器來完成的

乾杯,羅伯特

相關內容