hyprwm / Hyprland

Hyprland is a highly customizable dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
17.96k stars 754 forks source link

Idle Listener timer not reset after resume from hibernation #6451

Open marvinjuette opened 2 weeks ago

marvinjuette commented 2 weeks ago

Bug or Regression?

Bug

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit ea2501d4556f84d3de86a4ae2f4b22a474555b9f (props: bump version to 0.41.0). Date: Mon Jun 10 14:23:06 2024 Tag: v0.41.0, commits: 4794 flags: (if any) System Information: System name: Linux Node name: laptop Release: 6.6.32-1-lts Version: #1 SMP PREEMPT_DYNAMIC Sat, 25 May 2024 20:20:51 +0000 GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] [8086:3ea0] (rev 02) (prog-if 00 [VGA controller]) DeviceName: VGA DeviceName: Second VGA os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ======Config-Start====== Config File: /home/marvin/.config/hypr/hyprland.conf: Read Succeeded monitor=eDP-1,highres,auto,1 exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 exec-once = eww open bar exec-once = dunst exec-once = hypridle exec-once = nextcloud --background exec-once = gsettings set org.gnome.desktop.interface cursor-theme 'breeze' exec-once = sleep 0 && hyprpaper env = GTK_THEME,Nord env = WLR_NO_HARDWARE_CURSORS,1 input { kb_layout = de kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 0 touchpad { disable_while_typing = 1 natural_scroll = yes } sensitivity = 0 } general { gaps_in = 5 gaps_out = 10 border_size = 2 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) layout = master } decoration { rounding = 5 blur { enabled = true size = 3 passes = 2 new_optimizations = true xray = true ignore_opacity = true blurls = lockscreen } drop_shadow = yes shadow_range = 3 shadow_render_power = 2 col.shadow = rgba(1a1a1aee) } animations { enabled = no bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 2, myBezier animation = windowsOut, 1, 2, default, popin 80% animation = border, 1, 2, default animation = fade, 1, 2, default animation = workspaces, 1, 2, default } dwindle { pseudotile = yes preserve_split = yes no_gaps_when_only = false } master { new_is_master = false no_gaps_when_only = false } misc { disable_hyprland_logo = true disable_splash_rendering = true } gestures { workspace_swipe = yes } # window rules windowrule=float,Rofi windowrulev2=float,class:^(org.telegram.desktop|telegramdesktop)$,title:^(Media viewer)$ # key bindings $mainMod = SUPER $shiftMod = SUPERSHIFT bind = $mainMod, Q, killactive, bind = $mainMod, T, exec, kitty bind = $mainMod, M, exec, spotify bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, rofi -modi drun -show drun bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, B, exec, firefox bind = $mainMod, F, fullscreen, 1 bind = $mainMod, RETURN, exec, kitty bind = $shiftMod, M, exit, bind = $shiftMod, F, fullscreen, 0 bind = $shiftMod, L, exec, hyprlock bind = $shiftMod, S, exec, slurp | grim -g - bindl = $mainMod, ESCAPE, exec, systemctl hibernate # music controls bind = $shiftMod, N, exec, playerctl next bind = $shiftMod, P, exec, playerctl previous bind = $shiftMod, SPACE, exec, playerctl play-pause # monitor order # office monitor setup bind = $shiftMod, T, exec, hyprctl keyword monitor HDMI-A-2,highres,0x0,1 && hyprctl keyword monitor eDP-1,highres,320x1440,1 && eww open bar2 # switch focus bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d # switch focus (vim) bind = $mainMod, H, movefocus, l bind = $mainMod, J, movefocus, d bind = $mainMod, K, movefocus, u bind = $mainMod, L, movefocus, r # window layout bind = $mainMod, G, exec, hyprctl keyword general:gaps_in 5 && hyprctl keyword general:gaps_out 10 bind = $shiftMod, G, exec, hyprctl keyword general:gaps_in 0 && hyprctl keyword general:gaps_out 0 # switch workspaces bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # move window to new workspace bind = $shiftMod, 1, movetoworkspacesilent, 1 bind = $shiftMod, 2, movetoworkspacesilent, 2 bind = $shiftMod, 3, movetoworkspacesilent, 3 bind = $shiftMod, 4, movetoworkspacesilent, 4 bind = $shiftMod, 5, movetoworkspacesilent, 5 bind = $shiftMod, 6, movetoworkspacesilent, 6 bind = $shiftMod, 7, movetoworkspacesilent, 7 bind = $shiftMod, 8, movetoworkspacesilent, 8 bind = $shiftMod, 9, movetoworkspacesilent, 9 bind = $shiftMod, 0, movetoworkspacesilent, 10 # move workspace to specified monitor output bind = $shiftMod, F1, movecurrentworkspacetomonitor, eDP-1 bind = $shiftMod, F2, movecurrentworkspacetomonitor, HDMI-A-2 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # fn keys # audio bindl =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bindle =, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ bindle =, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- # Brightness bindle =, XF86MonBrightnessUp, exec, brightnessctl s 5%+ bindle =, XF86MonBrightnessDown, exec, brightnessctl s 5%- # auto start exec-once = [workspace 1 silent] firefox exec-once = [workspace 2 silent] kitty exec-once = [workspace 3 silent] spotify exec-once = [workspace 7 silent] keepassxc exec-once = [workspace 8 silent] thunderbird exec-once = [workspace 9 silent] telegram-desktop exec-once = [workspace 10 silent] cinny ======Config-End======== ```

Description

I started using hypridle to put my system to hibernate after a certain amount of time (e.g. 20 minutes). But when I put my system into hibernation state manually and turn it on and resume later on (the time limit needs to be exceeded), the listener of hypridle seems to recognize that the timer for hibernation is overdue and immediately puts my system back into hibernation. After a second boot/resume, the system stays awake because the hypridle action is not triggered again.

Since I commented out the config for hibernation, the issue was resolved.

The behavior I expected would be, that (all) timers of hypridle would be reset, after a boot/resume from a hibernated state.

I also created a bug report at the hypridle repo, where I was told, that this is more likely to be an issue with my compositor which is Hyprland.

How to reproduce

I used the following command in my hypridle. To reproduce the bug, I would recommend setting the timeout to a smaller number and put your system into hibernate. After a bit of time (long enough to reach the timeout) resume your system. It should go immediately back to hibernation.

listener {
    timeout = 900
    on-timeout = [[ "$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep state: | sed 's/\s*state:\s*//g')" == "discharging" ]] && systemctl hibernate
}

Crash reports, logs, images, videos

No response

vaxerski commented 2 weeks ago

yeah the question is how would hyprland detect hibernation. We could have a timekeeper, which would ping the event loop every 60s and if the time delta is seriously more (e.g. 120s) we can assume some sleep happened, I guess?

But then we can't do it real-time (aka we just un-hibernated NOW)