Hyprland/src/protocols
staticssleever668 d679d20029
seat: avoid sending pointless 'keymap' and 'repeat_info' events (#8276)
#### Describe your PR, what does it fix/add?

Fix lag spikes when pressing more than 6 keys at the same time.

 #### Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Debugging process:
<details>
This is triggered by typing some applications, like CopyQ or XWayland.
Typing in Firefox doesn't lead to lag, however it itself does lag
handling these events.

Profiling CopyQ shows that paths leading to
`QtWaylandClient::QWaylandInputDevice::Keyboard::keyboard` take over
80% of processing time of an otherwise idle program.

Looking at output of 'wev' even when it's not focused shows same events
received over and over again.

```
[14:     wl_keyboard] repeat_info: rate: 25 keys/sec; delay: 300 ms
[14:     wl_keyboard] keymap: format: 1 (xkb v1), size: 64754
```

Looking at what passes through CInputManager::onKeyboardKey() ->
CSeatManager::setKeyboard() shows Hyprland 'switching' between endpoints
of the same keyboard, one of them being named like the other but with
'-1' suffix.
</details>

Tested changing layouts in Fcitx5 and with following config.

```
input:kb_layout = us,cz
input:kb_variant = ,qwerty
input:kb_options = grp:alt_shift_toggle
```

Also tested changing 'input:repeat_delay' while running.

Curiously, now these events appear in the output of 'wev' only once.
Changing layouts still seems to work fine though.

 #### Is it ready for merging, or does it need work?

Ready for merging.
2024-10-28 19:25:27 +00:00
..
core seat: avoid sending pointless 'keymap' and 'repeat_info' events (#8276) 2024-10-28 19:25:27 +00:00
types dmabuffer: attempt importing failed dmabufs as implicit 2024-09-20 10:47:41 +01:00
AlphaModifier.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
AlphaModifier.hpp core: move to hyprutils for utils (#6385) 2024-06-11 17:17:45 +02:00
CTMControl.cpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
CTMControl.hpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
CursorShape.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
CursorShape.hpp cursor-shape: allow duplicate devices per pointer resource 2024-04-30 00:05:29 +01:00
DataDeviceWlr.cpp internal: Remove some unused lambda captures (#8218) 2024-10-24 13:12:41 +01:00
DataDeviceWlr.hpp primary-selection: move to hyprland impl 2024-05-14 23:13:35 +01:00
DRMLease.cpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
DRMLease.hpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
DRMSyncobj.cpp drm-syncobj: fix crash on missing timelines 2024-10-12 17:56:46 +01:00
DRMSyncobj.hpp drm-syncobj: fixup fd leak with timelines 2024-08-07 16:08:50 +02:00
FocusGrab.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
FocusGrab.hpp internal: nuke wlsignal and related 2024-09-24 00:47:34 +01:00
ForeignToplevel.cpp foreign-toplevel: don't send updates to X11 OR windows 2024-10-19 16:09:53 +01:00
ForeignToplevel.hpp foreign-toplevel: don't send updates to X11 OR windows 2024-10-19 16:09:53 +01:00
ForeignToplevelWlr.cpp core: move internal structures to monitor pointers (#8266) 2024-10-27 18:45:38 +00:00
ForeignToplevelWlr.hpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
FractionalScale.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
FractionalScale.hpp wayland/core: move to new impl (#6268) 2024-06-08 10:07:59 +02:00
GammaControl.cpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
GammaControl.hpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
GlobalShortcuts.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
GlobalShortcuts.hpp protocols: Move globalshortcuts impl (#7102) 2024-07-30 23:33:56 +02:00
IdleInhibit.cpp wayland/core: move to new impl (#6268) 2024-06-08 10:07:59 +02:00
IdleInhibit.hpp wayland/core: move to new impl (#6268) 2024-06-08 10:07:59 +02:00
IdleNotify.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
IdleNotify.hpp internal: new shared_ptr and weak_ptr implementation (#5883) 2024-05-05 17:16:00 +01:00
InputMethodV2.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
InputMethodV2.hpp Core: Move to aquamarine (#6608) 2024-07-21 13:09:54 +02:00
LayerShell.cpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
LayerShell.hpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
LinuxDMABUF.cpp core: move internal structures to monitor pointers (#8266) 2024-10-27 18:45:38 +00:00
LinuxDMABUF.hpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
MesaDRM.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
MesaDRM.hpp Core: Move to aquamarine (#6608) 2024-07-21 13:09:54 +02:00
OutputManagement.cpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
OutputManagement.hpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
OutputPower.cpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
OutputPower.hpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
PointerConstraints.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
PointerConstraints.hpp pointer-constraint: set lifetime correctly 2024-06-29 00:18:24 +02:00
PointerGestures.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
PointerGestures.hpp core: Move to hyprutils for Math 2024-06-19 16:20:15 +02:00
PresentationTime.cpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
PresentationTime.hpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
PrimarySelection.cpp internal: Remove some unused lambda captures (#8218) 2024-10-24 13:12:41 +01:00
PrimarySelection.hpp primary-selection: move to hyprland impl 2024-05-14 23:13:35 +01:00
RelativePointer.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
RelativePointer.hpp core: Move to hyprutils for Math 2024-06-19 16:20:15 +02:00
Screencopy.cpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
Screencopy.hpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
SecurityContext.cpp security-context: avoid UB in C macro (#8229) 2024-10-25 11:26:48 +01:00
SecurityContext.hpp security-context: avoid UB in C macro (#8229) 2024-10-25 11:26:48 +01:00
ServerDecorationKDE.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
ServerDecorationKDE.hpp wayland/core: move to new impl (#6268) 2024-06-08 10:07:59 +02:00
SessionLock.cpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
SessionLock.hpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
ShortcutsInhibit.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
ShortcutsInhibit.hpp wayland/core: move to new impl (#6268) 2024-06-08 10:07:59 +02:00
SinglePixel.cpp single-pixel: set buffer size to 1,1 2024-10-05 16:36:57 +01:00
SinglePixel.hpp single-pixel-buffer: new protocol impl 2024-09-30 00:58:16 +01:00
Tablet.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
Tablet.hpp Core: Move to aquamarine (#6608) 2024-07-21 13:09:54 +02:00
TearingControl.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
TearingControl.hpp wayland/core: move to new impl (#6268) 2024-06-08 10:07:59 +02:00
TextInputV1.cpp textinput: handle IME resetting (#7731) 2024-09-10 14:49:10 +01:00
TextInputV1.hpp security-context: implement protocol 2024-10-06 14:07:07 +01:00
TextInputV3.cpp textinput: handle IME resetting (#7731) 2024-09-10 14:49:10 +01:00
TextInputV3.hpp textinput: handle IME resetting (#7731) 2024-09-10 14:49:10 +01:00
ToplevelExport.cpp core: move internal structures to monitor pointers (#8266) 2024-10-27 18:45:38 +00:00
ToplevelExport.hpp internal: Move CMonitor to SP (#8178) 2024-10-19 23:03:29 +01:00
Viewporter.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
Viewporter.hpp Core: Move to aquamarine (#6608) 2024-07-21 13:09:54 +02:00
VirtualKeyboard.cpp misc: constify the remaining for loops (#7534) 2024-08-26 20:24:30 +02:00
VirtualKeyboard.hpp Core: Move to aquamarine (#6608) 2024-07-21 13:09:54 +02:00
VirtualPointer.cpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
VirtualPointer.hpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
WaylandProtocol.cpp security-context: implement protocol 2024-10-06 14:07:07 +01:00
WaylandProtocol.hpp security-context: implement protocol 2024-10-06 14:07:07 +01:00
XDGActivation.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
XDGActivation.hpp xdg-activation: keep tokens after the resource is dead 2024-05-08 22:17:17 +01:00
XDGDecoration.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
XDGDecoration.hpp xdg-decoration: move to new impl 2024-04-21 20:04:58 +01:00
XDGDialog.cpp xdg-dialog: implement new protocol 2024-08-30 15:53:44 +02:00
XDGDialog.hpp xdg-dialog: implement new protocol 2024-08-30 15:53:44 +02:00
XDGOutput.cpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
XDGOutput.hpp internal: cleanup CMonitor usage and fix a few ref hogs 2024-10-26 02:06:13 +01:00
XDGShell.cpp xdg-dialog: implement new protocol 2024-08-30 15:53:44 +02:00
XDGShell.hpp xdg-dialog: implement new protocol 2024-08-30 15:53:44 +02:00
XWaylandShell.cpp protocols: refactor protocol logging to a macro (#7324) 2024-08-15 17:16:18 +01:00
XWaylandShell.hpp wayland/core: move to new impl (#6268) 2024-06-08 10:07:59 +02:00