Bug 474469

Summary: (Custom Shortcut) command execution has a slight delay on shortcut pressed
Product: [Frameworks and Libraries] frameworks-kglobalaccel Reporter: unblended_icing552
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: nate, qydwhotmail, unblended_icing552
Priority: NOR    
Version First Reported In: 5.109.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description unblended_icing552 2023-09-13 03:26:43 UTC
SUMMARY
On Plasma **Wayland** session, custom shortcut command executes with a slight delay instead of instantaneously.

STEPS TO REPRODUCE
1. Install `ydotool` https://github.com/ReimuNotMoe/ydotool and setup uinput permission correctly
2. Start `ydotoold` as current user
3. In Shortcuts Settings page, select "Add Command"
4. `ydotool mousemove -- 0 -50`
5. Assign a shortcut to the command
6. Press that shortcut

OBSERVED RESULT
Mouse cursor position moves with a slight delay.

EXPECTED RESULT
Mouse cursor position should move right after the shortcut is pressed, similar to when it's executed in a terminal emulator like Konsole.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 2.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
It's Wayland session instead of X11 session.

`ydotoold` needs to be running as current user. To setup uinput permission:
```bash
cat << 'EOF' | sudo tee /etc/udev/rules.d/99-uinput.rules > /dev/null
KERNEL=="uinput", GROUP="input", MODE="0660"
EOF
sudo udevadm control --reload-rules
sudo udevadm trigger /dev/uinput
sudo usermod -aG input $USER
```
Comment 1 Nate Graham 2023-09-13 17:36:49 UTC
Can you reproduce the issue with other scripts not using ydotool? It's as instant as I can perceive with other commands.
Comment 2 Fushan Wen 2023-09-13 17:48:12 UTC
Reproducible with notify-send