From 012df9dcd72cc2ced49f3afd43d58cac81769041 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:11:40 +0700 Subject: [PATCH] hyprlandxkb: dont update when not necessary --- .config/quickshell/services/HyprlandXkb.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/services/HyprlandXkb.qml b/.config/quickshell/services/HyprlandXkb.qml index bb842487..76a7bd35 100644 --- a/.config/quickshell/services/HyprlandXkb.qml +++ b/.config/quickshell/services/HyprlandXkb.qml @@ -91,9 +91,12 @@ Singleton { root.needsLayoutRefresh = false; fetchLayoutsProc.running = true; } + + // If there's only one layout, the updated layout is always the same + if (root.layoutCodes.length <= 1) return; + // Update when layout might have changed const dataString = event.data; - // console.log("[HyprlandXkb] Received raw event:", event.name, "with data:", dataString); if (!dataString.startsWith(root.targetDeviceName)) return; root.currentLayoutName = dataString.split(",")[1];