Open littleblack111 opened 3 weeks ago
I can reproduce the issue with numlock_by_default = true
after config is reloaded.
This patch fixes it for me
```patch diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp index d1119772..b50c094f 100644 --- a/src/devices/IKeyboard.cpp +++ b/src/devices/IKeyboard.cpp @@ -115,12 +115,13 @@ void IKeyboard::setKeymap(const SStringRuleNames& rules) { if (NUMLOCKON == 1) { // lock numlock const auto IDX = xkb_map_mod_get_index(xkbKeymap, XKB_MOD_NAME_NUM); + auto locked = modifiersState.locked; if (IDX != XKB_MOD_INVALID) - modifiersState.locked |= (uint32_t)1 << IDX; + locked |= (uint32_t)1 << IDX; // 0 to avoid mods getting stuck if depressed during reload - updateModifiers(0, 0, modifiersState.locked, modifiersState.group); + updateModifiers(0, 0, locked, modifiersState.group); } for (size_t i = 0; i < LEDNAMES.size(); ++i) { ```
Does it work for you?
I'm on d679d200299ed4670f0d0f138c793d5f507b7cec aquamarine 8d732fa
hmm... doesnt seem to work, but i wonder how would defining a new var that is the same value as the old one and using the new one work.
Strange. Can you reproduce the issue without numlock on by default? Because I can't. Maybe we're talking about different issues, but it didn't reset for me after more than 20 minutes.
But for me without this patch, when numlock is on by default, after config reload it stays on (predictably), including LED, but no longer actually in effect.
It could work because of this line inside `updateModifiers()` https://github.com/hyprwm/Hyprland/blob/d679d200299ed4670f0d0f138c793d5f507b7cec/src/devices/IKeyboard.cpp#L345-L346 that checks if `modifiersState` still matches real `xkbState` https://github.com/hyprwm/Hyprland/blob/d679d200299ed4670f0d0f138c793d5f507b7cec/src/devices/IKeyboard.cpp#L362-L368 and if it doesn't - then it sends the event that notifies things of these changes. But if `modifiersState` was modified outside the method (like without the patch), the event will not be emitted, as https://github.com/hyprwm/Hyprland/blob/d679d200299ed4670f0d0f138c793d5f507b7cec/src/devices/IKeyboard.cpp#L340 is always called first, so `modifiersState` variables will be equal to all of that here https://github.com/hyprwm/Hyprland/blob/d679d200299ed4670f0d0f138c793d5f507b7cec/src/devices/IKeyboard.cpp#L362-L365
So I assumed that depressed
(mods pressed) and latched
(stuff to type diacritics about to go) to were zero anyway (won't influence the check), locked
was whatever it is for your keyboard when numlock is already on, and group
was whatever it is for us
(which what you have in your config and is also default group).
So no changes, meaning no event, meaning default state of numlock as off, while leds stay on.
hmm i see. I will check tmr, it's pretty late here and im abt to sleep
A proper repro for testing:
numlock_by_default = true
.us
)hyprctl reload
Never mind lol.
I bisected (manually), and
GOOD d679d200 seat: avoid sending pointless 'keymap' and 'repeat_info' events (8276) BAD 7188ee4f hyprctl: move setprop into dispatchers (8275) c7315617 internal: few more marginal optimisations from profiling (8271) BAD d49a1334 swallow: check if swallow_regex doesn't exist (8265) 2c481202 layout: slight adjustments to snapping logic (8273) BAD 6cf193e1 layout: don't snap to self and allow same-pid snaps
(GOOD - numlock stays on for real after config reload)
Checking on 7188ee4f992966c5793efebd6dc70ab377820066 + patch - it doesn't seem to fix it anyway.
No patch is needed, update to latest git.
hang tight, im compiling(with input-capture), i skiped a rebase conflict thats not this commit cuz i dont have time for this.
also I cannot repro with hyprctl reload, I have to just wait a while
EDIT: nope it didnt not fix it for me, but seems to somewhat mitigate it
I can reproduce it on my Bluetooth keyboard, maybe it does work with wired? Though I'm using NixOS 24.05 with quite old Hyprland rev: 66586c38f53f16bcf762f019359a3c9042546a72
I had an issue, where my wired numpad didnt work at all even with numlock_by_default = true
.
I managed to make it work by adding this to hyprland input config kb_options: numpad:mac
. I am not sure if it can be related at all, but hopefully it helps someone.
Already reported ? *
Regression?
Yes
System Info and Version
System/Version info
```sh Hyprland 0.44.0 built from branch main at commit 4da3d7412dfc5525f8dd6f8ed5c85cc3ad0ae6a7 (input-capture: fix rebase issues). Date: Mon Oct 28 19:31:36 2024 Tag: v0.44.0-96-g4da3d741, commits: 5395 built against aquamarine 0.4.2 flags set: debug System Information: System name: Linux Node name: Arch-Linux Release: 6.11.5-zen1-1-zen Version: #1 ZEN SMP PREEMPT_DYNAMIC Tue, 22 Oct 2024 18:31:33 +0000 GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation Raptor Lake-S GT1 [UHD Graphics 770] [8086:a780] (rev 04) (prog-if 00 [VGA controller]) 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation AD103 [GeForce RTX 4080 SUPER] [10de:2702] (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: ======Config-Start====== Config File: /home/system/.config/hypr/hyprland.conf: Read Succeeded ################ ### MONITORS ### ################ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,highres@highrr,auto,auto,bitdepth,10 # monitor=,preferred,auto,auto,bitdepth,10 ################### ### MY PROGRAMS ### ################### # Program defaults $terminal = alacritty $termfloat = [float; size 40% 40%; workspace +0] alacritty $editor = lvim # $browser = thorium-browser $browser = zen-browser $fileManager = thunar $sessionManager = sddm $menu = rofi -i -dmenu -theme $HOME/.config/rofi/configs.rasi # Dirs $HYPRDIR = $HOME/.config/hypr $WAYBARDIR = $HOME/.config/waybar $SCRIPTSDIR = $HOME/scripts $rofiexec = $HOME/.config/rofi/scripts # global vars $outer_gaps = 12 source = $HYPRDIR/colors.conf # misc $waylandarg = --enable-features=WaylandWindowDecorations,UseOzonePlatform --ozone-platform-hint=auto ##################### ### LOOK AND FEEL ### ##################### # Refer to https://wiki.hyprland.org/Configuring/Variables/ # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 5 gaps_out = 7 border_size = 3 # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors # col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg # DO THIS LATER # col.inactive_border = rgba(595959aa) # col.active_border = rgb(00a7f5) rgb(538620) rgb(538620) rgb(00a7f5) 90deg # col.inactive_border = rgb(00a7f5) rgb(538620) rgb(538620) rgb(00a7f5) 90deg # col.active_border = rgb(00a7f5) rgb(538620) # col.inactive_border = rgb(00a7f5) rgb(538620) col.inactive_border = $background col.active_border = $color15 $color13 $color10 $color8 $color6 $color4 $color2 $color0 # 45deg # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = false # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = true layout = dwindle snap { enabled = true } } xwayland { force_zero_scaling = true } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 7 # Change transparency of focused and unfocused windows active_opacity = 0.95 inactive_opacity = 0.85 fullscreen_opacity = 1.0 drop_shadow = true shadow_range = 15 shadow_render_power = 4 # col.shadow = rgba(1a1a1aee) col.shadow = $background screen_shader = /usr/share/hyprshade/shaders/vibrance.glsl # dim_inactive = true # dim_strength = 0.4 # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = true size = 6 passes = 3 # vibrancy = 1 popups = true ignore_opacity = true # KEEP THIS, THIS MAKE BLUR ACTUALLY BLUR COOL } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = true # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = windowovershot, 1, 1, 0, 1.05 bezier = overshot, 0.5, 1, 0, 1.2 # bezier = outsideIn, 0.5, 1.1, 0, 0.9 bezier = slow-fast, 1, 0.33, 0.3, 1 bezier = fast-slow, 0.33, 0.8, 0, 1 bezier = linear, 0, 0, 1, 1 # bezier = linear, 0, 0, 1, 1 # bezier = md3_standard, 0.2, 0, 0, 1 bezier = md3_decel, 0.05, 0.7, 0.1, 1 # bezier = md3_accel, 0.3, 0, 0.8, 0.15 # bezier = overshot, 0.05, 0.9, 0.1, 1.1 # bezier = crazyshot, 0.1, 1.5, 0.76, 0.92 # bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0 # bezier = menu_decel, 0.1, 1, 0, 1 # bezier = menu_accel, 0.38, 0.04, 1, 0.07 # bezier = easeInOutCirc, 0.85, 0, 0.15, 1 # bezier = easeOutCirc, 0, 0.55, 0.45, 1 # bezier = easeOutExpo, 0.16, 1, 0.3, 1 # bezier = softAcDecel, 0.26, 0.26, 0.15, 1 # bezier = md2, 0.4, 0, 0.2, 1 # use with .2s duration animation = fade, 1, 4, md3_decel animation = windows, 1, 3, overshot # animation = windowsOut, 1, 2, slow-fast, popin 15% animation = windowsOut, 1, 2, slow-fast, popin 15% # animation = windowsMove, 1, 2, md3_accel # when new window appears, it will block it for a while since its slower then windowIn animation animation = workspaces, 1, 6, fast-slow, slide animation = workspacesIn, 1, 6, fast-slow, slidefade animation = borderangle, 1, 100, linear, loop } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this force_split = 3 } # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = 1 # Set to 0 or 1 to disable the anime mascot wallpapers focus_on_activate = true disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( # vfr = false # vrr = 1 # 1 = always, 2 = only in full screen mouse_move_enables_dpms = true key_press_enables_dpms = true # animate_manual_resizes = true # animate_mouse_windowdragging = true middle_click_paste = false enable_swallow = false # true swallow_regex = ^(Alacritty)$ new_window_takes_over_fullscreen = 2 } group { groupbar { # enabled = false render_titles = false text_color = $foreground col.active = $color0 col.inactive = $background col.locked_active = $color0 col.locked_inactive = $background } col.border_active = $color0 $color15 $foreground $cursor col.border_inactive = $background col.border_locked_active = $color0 $background col.border_locked_inactive = $background } # binds { # workspace_back_and_forth = true # } render { explicit_sync = 1 explicit_sync_kms = 1 direct_scanout = true } opengl { # nvidia_anti_flicker = false # force_introspection = 0 } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 1 # scroll_factor = 1.0 # sensitivity = 0 # -1.0 - 1.0, 0 means no modification. numlock_by_default = true # touchpad { # natural_scroll = false # } } cursor { # allow_dumb_copy = true no_hardware_cursors = true no_break_fs_vrr = true # zoom_rigid = true persistent_warps = true } plugin { overview { enabled = true disableGestures = true panelHeight = 150 } # hyprfocus { # enabled = yes # focus_animation = shrink # animate_floating = yes # animate_worksapcechange = yes # } dynamic-cursors { mode = stretch shake { effects = true } shaperule = text, none # shaperule = clientside, none } # chromakey_background = $background # hy3 { # # disable gaps when only one window is onscreen # # 0 - always show gaps # # 1 - hide gaps with a single window onscreen # # 2 - 1 but also show the window border # # no_gaps_when_only =Description
same issue as prev num lock issues, num lock is on, but the input is not number. had to disable and renable to type number and will reset every ~5min(have to repeat above to get numlock working).
im pretty sure this is a reggression and is fixed but is broken again
How to reproduce
Crash reports, logs, images, videos
No response