hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.75k stars 900 forks source link

submap interactions w/ wtype and xfce4-terminal #3165

Open alaricljs opened 1 year ago

alaricljs commented 1 year ago

Hyprland Version

Hyprland, built from branch at commit 0a78f6031c8fcc6773f136fccde3d560aaac239d dirty (). Tag: v0.29.0 flags: (if any)

Bug or Regression?

Bug

Description

wtype activated from a bind submap acts a bit oddly depending on focused terminal. (xfce4-terminal, kitty)

Results: Activated with kitty as the active window w/ zsh executing cat: the first letter ('A') does not get output

Activated with xfce4-terminal as the active window w/ zsh executing cat: the first letter ('A') does not get output, the 'f' somehow triggers the terminal's Find (Super-F), the 'g' may or may not show up or get lost and the remainder 'h-z' land in the find dialog.

If I hit escape before the wtype command starts its output then the first letter does get output. Alternatively, the Escape can be output by wtype and successfully output the 'A'. That's not unreasonable as a requirement for it to work rather than making adjustments to submap behavior, at least in this use case.

The truly oddball bit is the Find dialog popping on xfce4-terminal.

Late add: (gvim behaves the same as kitty)

How to reproduce

$deskMod = SUPER  #  Or Alt, or whatever... doesn't impact the results
bind = $deskMod, P, submap, test
submap = test
bind = , o, exec, wtype -s 200 -- ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
bind = , escape, submap, reset
submap = reset

Activate the keybind with a xfce4-terminal active/focused and watch the strange.

Crash reports, logs, images, videos

[LOG] Executing WAYLAND_DISPLAY=wayland-1 DISPLAY=:1 wtype -s 100 -k Escape -s 200 -- ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
[LOG] Process Created with pid 221370
[LOG] Registered signal for owner 556c542fee20: 556c54310068 -> 556c542fee28 (owner: Keyboard)
[LOG] Registered signal for owner 556c542fee20: 556c54310058 -> 556c542fee90 (owner: Keyboard)
[LOG] Registered signal for owner 556c542fee20: 556c5430ff38 -> 556c542fef60 (owner: Keyboard)
[LOG] Registered signal for owner 556c542fee20: 556c54310078 -> 556c542feef8 (owner: Keyboard)
[LOG] ApplyConfigToKeyboard for "wlr_virtual_keyboard_v1", hasconfig: 0
[LOG] Attempting to create a keymap for layout us with variant  (rules: , model: , options: )
[LOG] Set the keyboard layout to us and variant to  for keyboard "wlr_virtual_keyboard_v1"
[LOG] New virtual keyboard created, pointers Hypr: 556c542fee20 and WLR: 556c5430ff20
[LOG] Keybind triggered, calling dispatcher (0, , 65307)
[LOG] Reset active submap to the default one.
[LOG] Callback 556c542fef88 -> 556c542fef80, Keyboard removed.
[LOG] Callback 556c542fee50 -> 556c542fee48, Keyboard removed.
[LOG] Callback 556c542feeb8 -> 556c542feeb0, Keyboard removed.
[LOG] Callback 556c542fef20 -> 556c542fef18, Keyboard removed.
[LOG] Destroyed keyboard 556c542fee20
alaricljs commented 1 year ago

Hmm, that xfce4-terminal thing isn't just in submaps, it's in regular bind's as well. And again, regardless of whether the bind contains Super or not.

vaxerski commented 1 year ago

mods are accumulated, so if it starts typing while you still are holding e.g. SUPER it will register a SUPER+(whatever wtype types)

I am unsure if I understand what the issue is though

alaricljs commented 1 year ago

I understand that any mods I'm pressing need to be released to not be part of any kb interaction, simulated or otherwise. There's a delay built in to the bind large enough for me to get my hands off the keyboard. For xfce4-terminal it's always Super-F when the f key is sent by wtype regardless of whether the bind is Super, Meta, Alt, or likely others. That's the issue - an unexpected result from 2 tools while running in Hyprland.

thrombe commented 7 months ago

similar issue for me on version 0.36.0 any use of wtype resets the submap

steps:

bind = SUPER, 1, submap, test
submap = test
bind = , escape, submap, reset
submap = reset

enter submap by pressing SUPER+1 execute wtype a on a terminal submap test is no longer active

el-Basketo commented 1 month ago

Yes, very much so.

The line: bind = $mod SHIFT, D, exec, wtype'test'`` in my config wrecks havoc, and does not even type "test". Some magical results include:

My active window is moved to WS#2, which means Hyprland somehow interprets something that happens as "MOD + SHIFT + 2", which is my "move to workspace 2" bind. No idea how, since the string "test" does not contain the character "2".

And my lockscreen is triggered, which means Hyprland somehow interprets something that happens as "MOD + SHIFT + ESCAPE" which is my lockscreen bind. (the screen lock seems to happen with any string)

I hope this gets solved, my workflow relies on being able to type runtime-evaluated strings into text fields using a shortcut. If it was only pre-determined strings, I could use the compose key for that. For example, what I need is to be able to type the current date with a bind. So the output of date +%x