Skip to content

Commit

Permalink
keyboard_layout_monitor_wayland: Mitigate log spam
Browse files Browse the repository at this point in the history
With this change we set the current group if already not
set and then look for presence of prveious notification of
xkb state/map. This will reduce the noise in the logs, since
we are seeing the compositor sending us the same group again.

Bug: chromium:1291247
Change-Id: If83e5de30e27d36304cbf99d2fe76ea5d0659963
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192068
Auto-Submit: Salman Malik <salmanmalik@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Commit-Queue: Salman Malik <salmanmalik@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096422}
  • Loading branch information
Salman authored and Chromium LUCI CQ committed Jan 24, 2023
1 parent b50b5de commit 2ab73f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions remoting/host/linux/keyboard_layout_monitor_wayland.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ void KeyboardLayoutMonitorWayland::ProcessModifiersAndNotifyCallbacks(
return;
}

current_group_ = static_cast<xkb_layout_index_t>(group);

if (!xkb_state_) {
LOG(WARNING) << "Received modifier without keymap?";
return;
}

current_group_ = static_cast<xkb_layout_index_t>(group);

DCHECK(keymap_);

layout_changed_callback_.Run(GenerateProtocolLayoutMessage());
Expand Down

0 comments on commit 2ab73f2

Please sign in to comment.