hyprwm / hyprlock

Hyprland's GPU-accelerated screen locking utility
BSD 3-Clause "New" or "Revised" License
827 stars 57 forks source link

Hyprlock not correctly seeing state of numlock for `input-field` widget while `invert_numlock = true` #528

Closed jasongraham closed 3 weeks ago

jasongraham commented 3 weeks ago

Regression?

Yes

Hyprlock Info and Version

$ hyprlock --version
Hyprlock version 0.5.0
Hyprlock config ```sh general { grace = 1 hide_cursor = true ignore_empty_input = true } background { monitor = DP-2 path = /tmp/DP-2.png # supports png, jpg, webp (no animations, though) # path = screenshot # not working on Nvidia right now color = rgba(40, 40, 40, 1.0) # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations blur_passes = 3 # 0 disables blurring blur_size = 7 noise = 0.0117 contrast = 0.8916 brightness = 0.8172 vibrancy = 0.1696 vibrancy_darkness = 0.0 } background { monitor = DP-1 path = /tmp/DP-1.png # supports png, jpg, webp (no animations, though) # path = screenshot # not working on Nvidia right now color = rgba(25, 20, 20, 1.0) # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations blur_passes = 3 # 0 disables blurring blur_size = 7 noise = 0.0117 contrast = 0.8916 brightness = 1 vibrancy = 0.1696 vibrancy_darkness = 0.0 } shape { monitor = DP-2 size = 360, 360 color = rgba(29, 32, 33, 0.98) rounding = -1 border_size = 8 border_color = rgba(168, 181, 84, 0.98) shadow_passes = 2 position = 0, 80 halign = center valign = center } label { monitor = DP-2 text_align = center text = cmd[update:100] echo "$(date +%l:%M:%S%P)" # text = $TIME12 color = rgba(221, 199, 161, 1.0) font_size = 40 font_family = FiraCode position = 0, 80 halign = center valign = center shadow_passes = 3 } label { monitor = DP-2 text_align = center text = $FAIL color = rgba(234, 105, 98, 1.0) font_size = 20 font_family = FiraCode position = 0, -240 halign = center valign = center shadow_passes = 3 } label { monitor = DP-2 text_align = center text = $ATTEMPTS[] color = rgba(234, 105, 98, 1.0) font_size = 20 font_family = FiraCode position = 0, -280 halign = center valign = center shadow_passes = 3 } # Doesn't display text as you type or show any messages, # but useful as an indicator that you are typing something input-field { monitor = DP-2 size = 0, 0 outline_thickness = 30 outer_color = rgb(151515) fade_on_empty = true fade_timeout = 2000 # Milliseconds before fade_on_empty is triggered. hide_input = true rounding = -1 # -1 means complete rounding (circle/oval) check_color = rgb(204, 136, 34) fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color fail_timeout = 5000 # milliseconds before fail_text and fail_color disappears fail_transition = 300 # transition time in ms between normal outer_color and fail_color capslock_color = rgb(204, 34, 34) numlock_color = rgb(204, 34, 34) bothlock_color = rgb(204, 34, 34) invert_numlock = true # change color if numlock is off swap_font_color = false # see below position = 0, -25 halign = center valign = center } ```

Compositor Info and Version

System/Version info ```sh Hyprland, built from branch at commit 4520b30d498daca8079365bdb909a8dea38e8d55 (version: bump to 0.44.1). Date: Wed Oct 9 12:54:39 2024 Tag: v0.44.1, commits: 5309 built against aquamarine 0.4.3 flags: (if any) System Information: System name: Linux Node name: jrg-desktop Release: 6.11.5-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Tue, 22 Oct 2024 18:31:38 +0000 GPU information: 1c:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1080] [10de:1b80] (rev a1) (prog-if 00 [VGA controller]) NVRM version: NVIDIA UNIX x86_64 Kernel Module 560.35.03 Fri Aug 16 21:39:15 UTC 2024 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: ```

Description

Thank you all for your hard work with the Hyprland tools.

Problem Description

After updating hyprlock from 0.4.1 to 0.5.0, the outside color (border color) of the input-field widget are continually stuck on my capslock_color/numlock_color/bothlock_color the rgb(204, 34, 34) red color regardless as to the state of capslock or numlock.

I have attempted changing the state of these while typing a password without success. I have also tried changing the state of these before hyprlock is invoked, without success.

Troubleshooting of configuration changes

Experiment 1: Changing invert_numlock to false

If I do change my configuration file to have the input-field widget's invert_numlock = false, I get expected behavior for this case (ie, I get the red outside color if either capslock or numlock are on). I do, however, want to be warned if numlock is off, which I believe is the intended behavior of the invert_numlock configuration option.

Experiment 2: Keeping invert_numlock as true, changing colors to see which rule is active with various capslock/numlock states

If I change the capslock_color, numlock_color, and bothlock_color to be distinct, I can clearly see that the numlock state detection is essentially stuck "on". Capslock changes seem to be detected properly.

How to reproduce

Using the provided hyprlock.conf file, lock the screen. Try changing numlock/capslock.

Try also changing prior to executing hyprlock without any different behavior.

Crash reports, logs, images, videos

Hyprlock log

I don't see anything noted about changes in state for numlock or capslock within. The errors for missing images are because the usual wrapper I use which generates modified screenshots isn't being run.

[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]    > Bound to wl_compositor v6
[LOG]   | got iface: wl_subcompositor v1
[LOG]   | got iface: wl_shm v1
[LOG]   | got iface: wp_viewporter v1
[LOG]    > Bound to wp_viewporter v1
[LOG]   | got iface: wp_tearing_control_manager_v1 v1
[LOG]   | got iface: wp_fractional_scale_manager_v1 v1
[LOG]    > Bound to wp_fractional_scale_manager_v1 v1
[LOG]   | got iface: zxdg_output_manager_v1 v3
[LOG]   | got iface: wp_cursor_shape_manager_v1 v1
[LOG]    > Bound to 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_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]   | got iface: ext_session_lock_manager_v1 v1
[LOG]    > Bound to 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: zwlr_screencopy_manager_v1 v3
[LOG]    > Bound to zwlr_screencopy_manager_v1 v3
[LOG]   | got iface: hyprland_toplevel_export_manager_v1 v2
[LOG]   | got iface: hyprland_global_shortcuts_manager_v1 v1
[LOG]   | got iface: xdg_dialog_v1 v1
[LOG]   | got iface: wp_single_pixel_buffer_manager_v1 v1
[LOG]   | got iface: wp_drm_lease_device_v1 v1
[LOG]   | got iface: wp_linux_drm_syncobj_manager_v1 v1
[LOG]   | got iface: wl_drm v2
[LOG]   | got iface: zwp_linux_dmabuf_v1 v5
[LOG]    > Bound to zwp_linux_dmabuf_v1 v5
[LOG]   | got iface: wl_output v4
[LOG]    > Bound to wl_output v4
[LOG]   | got iface: wl_output v4
[LOG]    > Bound to wl_output v4
[LOG] [core] dmabufFeedbackMainDevice
[LOG] output 49 name DP-1
[LOG] output 49 description ViewSonic Corporation VX2370 SERIES TA9135125140 (DP-1)
[LOG] output 49 make ViewSonic Corporation model VX2370 SERIES
[LOG] output 49 done
[LOG] output 50 name DP-2
[LOG] output 50 description ViewSonic Corporation VX2370 SERIES TA9142048806 (DP-2)
[LOG] output 50 make ViewSonic Corporation model VX2370 SERIES
[LOG] output 50 done
[LOG] Running on Hyprland
[LOG] Locking session
[LOG] Got fractional scale: 1
[LOG] Got fractional scale: 1
[LOG] configure with serial 48662
[LOG] Configuring surface for logical [Vector2D: x: 1920, y: 1080] and pixel [Vector2D: x: 1920, y: 1080]
[ERR] Resource background:/tmp/DP-2.png invalid (file not found)
[ERR] Resource background:/tmp/DP-1.png invalid (file not found)
[LOG] Got fractional scale: 1
[LOG] Got fractional scale: 1
[LOG] Got fractional scale: 1
[LOG] configure with serial 48663
[LOG] Configuring surface for logical [Vector2D: x: 1920, y: 1080] and pixel [Vector2D: x: 1920, y: 1080]
[LOG] Got fractional scale: 1
[LOG] onLockLocked called
[LOG] Clearing password buffer
[LOG] Clearing password buffer
[LOG] Authenticating
[LOG] PAM_PROMPT: Password: 
[LOG] auth: authenticated for hyprlock
[LOG] Unlocking session
[LOG] Unlocked, exiting!
[LOG] Reached the end, exiting
PaideiaDilemma commented 3 weeks ago

Thanks for your nice bug report. Culprit is a mistake I made in https://github.com/hyprwm/hyprlock/pull/469.