hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
404 stars 25 forks source link

inhibit locks < 0. Brought back to 0. #74

Open smitropoulos opened 5 months ago

smitropoulos commented 5 months ago

Hey, I got a message from hypridle, himself!

❯ hypridle
[LOG] Registered timeout rule for 90s:
      on-timeout: loginctl lock-session
      on-resume: 
[LOG] Registered timeout rule for 180s:
      on-timeout: hyprctl dispatch dpms off
      on-resume: hyprctl dispatch dpms on
[LOG] Registered timeout rule for 300s:
      on-timeout: systemctl suspend
      on-resume: 
[LOG]   | got iface: wl_seat v9
[LOG]    > Bound to wl_seat v9
[LOG]   | got iface: wl_data_device_manager v3
[LOG]   | got iface: wl_compositor v6
[LOG]   | got iface: wl_subcompositor v1
[LOG]   | got iface: wl_shm v1
[LOG]   | got iface: wp_viewporter v1
[LOG]   | got iface: wp_tearing_control_manager_v1 v1
[LOG]   | got iface: wp_fractional_scale_manager_v1 v1
[LOG]   | got iface: zxdg_output_manager_v1 v3
[LOG]   | got iface: wp_cursor_shape_manager_v1 v1
[LOG]   | got iface: zwp_idle_inhibit_manager_v1 v1
[LOG]   | got iface: zwp_relative_pointer_manager_v1 v1
[LOG]   | got iface: zxdg_decoration_manager_v1 v1
[LOG]   | got iface: wp_alpha_modifier_v1 v1
[LOG]   | got iface: zwlr_gamma_control_manager_v1 v1
[LOG]   | got iface: ext_foreign_toplevel_list_v1 v1
[LOG]   | got iface: zwp_pointer_gestures_v1 v3
[LOG]   | got iface: zwlr_foreign_toplevel_manager_v1 v3
[LOG]   | got iface: zwp_keyboard_shortcuts_inhibit_manager_v1 v1
[LOG]   | got iface: zwp_text_input_manager_v3 v1
[LOG]   | got iface: zwp_pointer_constraints_v1 v1
[LOG]   | got iface: zwlr_output_power_manager_v1 v1
[LOG]   | got iface: xdg_activation_v1 v1
[LOG]   | got iface: ext_idle_notifier_v1 v1
[LOG]    > Bound to ext_idle_notifier_v1 v1
[LOG]   | got iface: ext_session_lock_manager_v1 v1
[LOG]   | got iface: zwp_input_method_manager_v2 v1
[LOG]   | got iface: zwp_virtual_keyboard_manager_v1 v1
[LOG]   | got iface: zwlr_virtual_pointer_manager_v1 v2
[LOG]   | got iface: zwlr_output_manager_v1 v4
[LOG]   | got iface: org_kde_kwin_server_decoration_manager v1
[LOG]   | got iface: hyprland_focus_grab_manager_v1 v1
[LOG]   | got iface: zwp_tablet_manager_v2 v1
[LOG]   | got iface: zwlr_layer_shell_v1 v5
[LOG]   | got iface: wp_presentation v1
[LOG]   | got iface: xdg_wm_base v6
[LOG]   | got iface: zwlr_data_control_manager_v1 v2
[LOG]   | got iface: zwp_primary_selection_device_manager_v1 v1
[LOG]   | got iface: xwayland_shell_v1 v1
[LOG]   | got iface: wl_drm v2
[LOG]   | got iface: zwp_linux_dmabuf_v1 v5
[LOG]   | got iface: hyprland_toplevel_export_manager_v1 v2
[LOG]   | got iface: zwp_text_input_manager_v1 v1
[LOG]   | got iface: hyprland_global_shortcuts_manager_v1 v1
[LOG]   | got iface: zwlr_screencopy_manager_v1 v3
[LOG]   | got iface: wp_drm_lease_device_v1 v1
[LOG]   | got iface: wp_drm_lease_device_v1 v1
[LOG]   | got iface: wl_output v4
[LOG]   | got iface: wl_output v4
[LOG]   | got iface: wl_output v4
[LOG] found 3 rules
[LOG] wayland done, registering dbus
[LOG] Using dbus path /org/freedesktop/login1/session/_32
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[WARN] BUG THIS: inhibit locks < 0. Brought back to 0.
[LOG] ScreenSaver inhibit: true dbus message from firefox with content video-playing
[LOG] Inhibit locks: 1
[LOG] Cookie 1337 sent
[LOG] ScreenSaver inhibit: false dbus message from firefox with content video-playing
[LOG] Inhibit locks: 0

I had noticed there was nothing running after being idle for hours for some days, and decided to manually run it.

This is my config:

general {
    lock_cmd = pidof hyprlock || hyprlock       # avoid starting multiple hyprlock instances.
    before_sleep_cmd = loginctl lock-session    # lock before suspend.
    after_sleep_cmd = hyprctl dispatch dpms on  # to avoid having to press a key twice to turn on the display.
}

listener {
    timeout = 90
    on-timeout = loginctl lock-session
}

listener {
    timeout = 180
    on-timeout = hyprctl dispatch dpms off
    on-resume =  hyprctl dispatch dpms on
}

listener {
    timeout = 300
    on-timeout = systemctl suspend
}
appleseedexm commented 2 weeks ago

Same here but instead it's steam or zen (but I suppose it's not the application's fault). AFAIK it doesnt matter if steam is on an active workspace or not.

...
[LOG] Inhibit locks: 1
[LOG] Cookie 1346 sent
[LOG] ScreenSaver inhibit: false dbus message from Steam (owner: :1.329) with content Client interface
[LOG] Inhibit locks: 0
[LOG] ScreenSaver inhibit: true dbus message from Steam (owner: :1.329) with content Client interface
[LOG] Inhibit locks: 1
[LOG] Cookie 1347 sent
[LOG] ScreenSaver inhibit: false dbus message from Steam (owner: :1.329) with content Client interface
[LOG] Inhibit locks: 0
[LOG] ScreenSaver inhibit: true dbus message from Steam (owner: :1.329) with content Client interface
[LOG] Inhibit locks: 1
[LOG] Cookie 1348 sent
[LOG] ScreenSaver inhibit: false dbus message from Steam (owner: :1.329) with content Client interface
[LOG] Inhibit locks: 0
[LOG] ScreenSaver inhibit: true dbus message from zen-alpha (owner: :1.76) with content video-playing
[LOG] Inhibit locks: 1
[LOG] Cookie 1349 sent
[LOG] ScreenSaver inhibit: false dbus message from zen-alpha (owner: :1.76) with content video-playing
[LOG] Inhibit locks: 0
appleseedexm commented 2 weeks ago

With the following config I am able to lock and unlock multiple times without issue (the first listener), but as soon as the second listener triggers hypridle will never trigger any listener again:

general {
    lock_cmd = pidof hyprlock || hyprlock       
    before_sleep_cmd = loginctl lock-session    
    after_sleep_cmd = hyprctl dispatch dpms on  on the display.
}

listener {
    timeout = 300                                 
    on-timeout = loginctl lock-session            
}

listener {
    timeout = 330                                
    on-timeout = hyprctl dispatch dpms off
    on-resume = hyprctl dispatch dpms on
}

Edit: not sure what to believe anymore, it does suddenly seem to work again, I will try a config with ignoring inhibits to figure out if its consistent now. I am now considering that multiple applications incorrectly use the dbus.