G-dH / advanced-alttab-window-switcher

A highly customizable replacement for Gnome Shell's Alt-Tab window and app switchers.
GNU General Public License v3.0
151 stars 11 forks source link

[BUG] Switcher reverse order shortcut stops working #67

Closed notpeelz closed 1 year ago

notpeelz commented 1 year ago

Describe the bug I have my window switcher set to a non-standard shortcut (hyper+Q, remapped via xkb options). When I press hyper+Q to cycle through windows, it works as expected. However, hyper+shift+Q stops working once AATWS is enabled, and stays broken even after the extension is disabled.

To reproduce Steps to reproduce the behavior:

  1. Start the GNOME shell with AATWS disabled
  2. Remap caps to hyper using xkb options:
    gsettings set org.gnome.desktop.input-sources xkb-options "['caps:hyper']"
  3. Set hyper+Q as your window switcher shortcut:
    gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Hyper>q']"
  4. Check that hyper+Q and hyper+shift+Q work as expected
  5. Enable AATWS
  6. hyper+shift+Q should no longer work

Expected behavior I expected the hyper+Q and hyper+shift+Q shortcuts to work just like they do with the default GNOME window switcher.

Desktop

G-dH commented 1 year ago

Sorry, forgotten condition in the refactored _keyPressHandler. Sending fix..

notpeelz commented 1 year ago

Hmm, 3f9b717 doesn't seem to fix it on my end.

G-dH commented 1 year ago

It works for me with 'q' but not with 'w' or 'a'. The problem is outside of AATWS, these key combinations don't work even with the default switcher. Gnome Shell provides an action parameter to the switcher, if it is not a supported action, the keypress is treated as a possible internal hotkey. The only way around this would be to read the shortcuts from dconf, which I'd like to avoid.

notpeelz commented 1 year ago

It works now. I just tested with all other extensions disabled and made sure to double-check all of my shortcuts in the GNOME settings. It seems like I had conflicting shortcuts. Interestingly, q, w and a all seem to work on my end. What version of GNOME are you on?

Edit: also it might be worth mentioning that I've cleared a ton of shortcuts I don't personally use (from both AATWS and the GNOME shell). It seems to help when it comes to these types of conflicts.

G-dH commented 1 year ago

Thanks for the info. My primary system is running 42.5, I tested it on Fedora 37 with GS 43.2 Wayland without AATWS and none of the keys work with Shift.

notpeelz commented 1 year ago

Ah it must be a conflict with the default GNOME shortcuts.

G-dH commented 1 year ago

I reset my keyboard shortcuts in GNOME Settings to defaults and 'q' stopped working, the action value is 0 which is NONE. But I didn't find any potentially conflicting shortcut..

notpeelz commented 1 year ago

That's strange. Back when I was still fiddling with my hotkeys, some would randomly stop working after initially appearing to work. Make sure to restart the GNOME shell between tests, in case it gets in an inconsistent state.

I also didn't do much testing with the vanilla switchers since w closes the selected window and I would often hit that by accident.

I can provide my GNOME dconf settings if you think that might help.

G-dH commented 1 year ago

Yeah, it's behaving strangely. Without my input, the backward shortcut (with Shift) was assigned to the switch-panel-backward key when I tried to set the switch-windows shortcut (without Shift) in GNOME Settings, but now I'm unable to reproduce it. In any case, the switch-windows-backward key must be set and any conflicting shortcut found and removed, then it should work.

notpeelz commented 1 year ago

For completeness, here's my shortcut settings:

[/org/gnome/desktop/wm/keybindings]
begin-move=@as []
begin-resize=@as []
close=['<Alt>F4', '<Hyper>Backspace', '<Hyper><Shift>x']
cycle-group=@as []
cycle-group-backward=@as []
cycle-panels=@as []
cycle-panels-backward=@as []
cycle-windows=@as []
cycle-windows-backward=@as []
maximize=@as []
minimize=['<Hyper>x']
move-to-workspace-down=@as []
move-to-workspace-left=['<Hyper><Shift><Alt>Left', '<Hyper><Shift>Page_Up']
move-to-workspace-right=['<Hyper><Shift><Alt>Right', '<Hyper><Shift>Page_Down']
move-to-workspace-up=@as []
show-desktop=['<Hyper>d']
switch-applications=@as []
switch-applications-backward=@as []
switch-group=['<Hyper>w']
switch-group-backward=['<Shift><Hyper>w']
switch-input-source=['<Hyper>space', 'XF86Keyboard']
switch-input-source-backward=['<Shift><Hyper>space', '<Shift>XF86Keyboard']
switch-panels=@as []
switch-panels-backward=@as []
switch-to-workspace-1=@as []
switch-to-workspace-down=@as []
switch-to-workspace-last=@as []
switch-to-workspace-left=['<Hyper>Page_Up']
switch-to-workspace-right=['<Hyper>Page_Down']
switch-to-workspace-up=@as []
switch-windows=['<Hyper>q']
switch-windows-backward=['<Shift><Hyper>q']
toggle-fullscreen=['<Shift><Hyper>f']
toggle-maximized=['<Hyper>f']
unmaximize=@as []
notpeelz commented 1 year ago

I just tested 3f9b717 again (tested if the bug repros before and after) and it seems like everything works fine now. Thanks a lot :)