Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

sendshortcut binds broken in certain applications

Open ari-rs opened this issue 1 year ago • 5 comments

Bug or Regression?

Bug

System Info and Version

System/Version info
Hyprland, built from branch main at commit 91fe58f8f278d126852877eadc87c50ca7b9b78d  (window: improve swallowing functionality).
Date: Sat Jun 15 11:20:41 2024
Tag: v0.41.1-18-g91fe58f8, commits: 4836

flags: (if any)


System Information:
System name: Linux
Node name: arch
Release: 6.9.4-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Wed, 12 Jun 2024 20:17:17 +0000


GPU information: 
2b:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA106 [GeForce RTX 3060 Lite Hash Rate] [10de:2504] (rev a1) (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

Description

sendshortcut binds do not working in certain applications like minecraft whilst in other applications it works flawlessly ex: firefox bindl = , F8, sendshortcut,CTRL SHIFT, m, class:^(vesktop)

How to reproduce

  1. load the keybind into your configuration
  2. focus in on certain application ex: minecraft (from prismlauncher AUR)
  3. activate bind
  4. check if bind succeeded in my use case vesktop mute/deafen

Crash reports, logs, images, videos

No response

ari-rs avatar Jun 18 '24 01:06 ari-rs

It might have something to do with XWayland as per #6174.

This diff removes some redundant comments, cleans up code, and makes wl -> xwl work, leaving xwl -> xwl in a kinda broken state (will send to current)

myryk31415 avatar Jun 18 '24 20:06 myryk31415

xwl -> xwl is not really possible

vaxerski avatar Jun 19 '24 14:06 vaxerski

the sendshortcut and pass dispatchers only work when the window is focused for electron and chromium applications running in wayland mode ( --enable-features=UseOzonePlatform --ozone-platform=wayland).

Ive tested:

Vesktop (wayland mode) Spotify (wayland mode) Chromium (wayland mode)

Results

All of them had the exact same behaviour. The bind and sendshortcut dispatchers only worked when the window was being focused.

I tested this with binds and the hyprctl dispatch method.

JonathanSteininger avatar Jul 08 '24 00:07 JonathanSteininger

I tested the keybinds on slack, brave, & firefox and it only works on firefox.

# works fine and opens a new tab in firefox
hyprctl dispatch sendshortcut 'CTRL, T, class:^(firefox)$'
# same command doesn't work in brave
hyprctl dispatch sendshortcut 'CTRL, T, class:^(brave-browser)$'

I also tried it in slack with wayland flags and it doesn't work

slack --enable-features=WebRTCPipeWireCapturer --enable-features=UseOzonePlatform --ozone-platform=wayland
hyprctl dispatch sendshortcut 'CTRL, K, class:^(Slack)$'

deepanchal avatar Aug 14 '24 01:08 deepanchal

I've been running into the same issue, and I'm quite sure that it occurs when trying to use sendshortcut while the current window is an xwayland window.

Interestingly, hyprctl dispatch sendshortcut ... reports "ok" even in this situation, despite the shortcut not actually being sent.

It also seems like sendshortcut doesn't work AT ALL if the target window is a native wayland window.

Bahnschrift avatar Oct 06 '24 09:10 Bahnschrift

I run into the same issue and @JonathanSteininger seems to be on a good track: it only happens with chromium / electron applications running under wayland. You need to focus the window to make it work.

I tested with other, non electron / chromium applications working on wayland (like wezterm) and the dispatcher works as intended with those.

Zhaith-Izaliel avatar Dec 18 '24 13:12 Zhaith-Izaliel

With the v0.46.2 rebuild with the new hyprutils, sendshortcut is only working when the target window is focused for me. It doesn't work when native wayland applications are focused anymore.

Bahnschrift avatar Dec 24 '24 05:12 Bahnschrift

hyprctl dispatch focuswindow class:vesktop && hyprctl dispatch sendshortcut CONTROL SHIFT, M, class:vesktop && hyprctl dispatch focuscurrentorlast

This horrible code works for me, i think some apps only listen to keyboard shortcuts if they are focused

Marty42780 avatar Jan 15 '25 18:01 Marty42780

Hello there!

This issue has been closed, as we are moving from issues to discussions. More about this can be found here and in #9854.

Firstly, please make sure this issue is still relevant in latest Hyprland. If so, we ask you to open a discussion (please read the discussion guidelines first, in the pinned post)

Thank you for your understanding!

vaxerski avatar Apr 05 '25 19:04 vaxerski