Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

The num lock indicator flickers

Open hdm9527 opened this issue 1 year ago • 10 comments

Hyprland Version

System/Version info
Hyprland, built from branch main at commit 387127b12ab5df8f8f40e8da7d76f47636562cab dirty (config: added option to choose the default monitor for the cursor (5847)).
Date: Fri May 3 09:39:19 2024
Tag: v0.39.1-134-g387127b1, commits: 4594

flags: (if any)


System Information:
System name: Linux
Node name: Arch
Release: 6.8.8-1-cachyos-echo-lto
Version: #1 SMP PREEMPT_DYNAMIC Sun, 28 Apr 2024 22:28:22 +0000


GPU information: 
64:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev c7) (prog-if 00 [VGA controller])


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:

Bug or Regression?

Bug

Description

The num lock indicator sometimes flickers during keyboard input.

How to reproduce

  1. Install hyprland-git.
  2. For example, the num lock indicator sometimes flickers when kitty is typing, and it sometimes happens with other programs as well.

Crash reports, logs, images, videos

No response

hdm9527 avatar May 03 '24 13:05 hdm9527

they indicator on the keyboard as in the led?

gulafaran avatar May 03 '24 15:05 gulafaran

they indicator on the keyboard as in the led?

Flickers only during keyboard input.

https://github.com/hyprwm/Hyprland/assets/39702328/19aa4606-3487-4e86-ab58-35144eeab380

hdm9527 avatar May 03 '24 15:05 hdm9527

yeah thats more likely an HW issue

gulafaran avatar May 03 '24 15:05 gulafaran

yeah thats more likely an HW issue

hyprland stable version works fine.

hdm9527 avatar May 03 '24 15:05 hdm9527

does something like this solve it?

diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index fb9d2b8a..597c3e17 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -956,8 +956,19 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
             wlrMods.locked |= (uint32_t)1 << IDX;
     }
 
-    if (wlrMods.locked != 0)
-        wlr_keyboard_notify_modifiers(wlr_keyboard_from_input_device(pKeyboard->keyboard), 0, 0, wlrMods.locked, 0);
+    if (wlrMods.locked != 0) {
+        auto keyboard = wlr_keyboard_from_input_device(pKeyboard->keyboard);
+        wlr_keyboard_notify_modifiers(keyboard, 0, 0, wlrMods.locked, 0);
+
+        uint32_t leds = 0;
+        for (uint32_t i = 0; i < WLR_LED_COUNT; ++i) {
+            if (xkb_state_led_index_is_active(keyboard->xkb_state, keyboard->led_indexes[i])) {
+                leds |= (1 << i);
+            }
+        }
+
+        wlr_keyboard_led_update(keyboard, leds);
+    }
 
     xkb_keymap_unref(KEYMAP);
     xkb_context_unref(CONTEXT);

if not this might atleast properly set the led light on launch depending on if the numlock_by_default is set to true or false in the config.

gulafaran avatar May 03 '24 18:05 gulafaran

does something like this solve it?

diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index fb9d2b8a..597c3e17 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -956,8 +956,19 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
             wlrMods.locked |= (uint32_t)1 << IDX;
     }
 
-    if (wlrMods.locked != 0)
-        wlr_keyboard_notify_modifiers(wlr_keyboard_from_input_device(pKeyboard->keyboard), 0, 0, wlrMods.locked, 0);
+    if (wlrMods.locked != 0) {
+        auto keyboard = wlr_keyboard_from_input_device(pKeyboard->keyboard);
+        wlr_keyboard_notify_modifiers(keyboard, 0, 0, wlrMods.locked, 0);
+
+        uint32_t leds = 0;
+        for (uint32_t i = 0; i < WLR_LED_COUNT; ++i) {
+            if (xkb_state_led_index_is_active(keyboard->xkb_state, keyboard->led_indexes[i])) {
+                leds |= (1 << i);
+            }
+        }
+
+        wlr_keyboard_led_update(keyboard, leds);
+    }
 
     xkb_keymap_unref(KEYMAP);
     xkb_context_unref(CONTEXT);

if not this might atleast properly set the led light on launch depending on if the numlock_by_default is set to true or false in the config.

patch failed image

hdm9527 avatar May 04 '24 04:05 hdm9527

vaxry seems to work in hypr speed, 1237732b97fcf21a19aed16f2ef966118a3ca2aa introduced a similiar thing, so try main again.

gulafaran avatar May 04 '24 08:05 gulafaran

vaxry seems to work in hypr speed, 1237732 introduced a similiar thing, so try main again.

This commit causes Hyprland to crash and needs to wait for vaxry to fix it. The flickering issue seems to be fixed as well.

hdm9527 avatar May 04 '24 08:05 hdm9527

vaxry seems to work in hypr speed, 1237732 introduced a similiar thing, so try main again.

This commit causes Hyprland to crash and needs to wait for vaxry to fix it. The flickering issue seems to be fixed as well.

was this on current main or did you go directly for https://github.com/hyprwm/Hyprland/commit/1237732b97fcf21a19aed16f2ef966118a3ca2aa since the commit after that one has a crash fix heh

gulafaran avatar May 04 '24 09:05 gulafaran

vaxry seems to work in hypr speed, 1237732 introduced a similiar thing, so try main again.

This commit causes Hyprland to crash and needs to wait for vaxry to fix it. The flickering issue seems to be fixed as well.

was this on current main or did you go directly for 1237732 since the commit after that one has a crash fix heh

🔔 Generate by https://chat.tinycms.xyz:3002/


1237732 should have fixed it. Hyprland compiled from the main branch crashes frequently, so I reverted to 1d2acbe, and the crash is related to 1237732.

hdm9527 avatar May 04 '24 09:05 hdm9527