Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Window Switch from Alt+Tab #1867

Open
1 of 2 tasks
cab-1729 opened this issue Jul 9, 2023 · 9 comments
Open
1 of 2 tasks

[BUG] Window Switch from Alt+Tab #1867

cab-1729 opened this issue Jul 9, 2023 · 9 comments
Labels

Comments

@cab-1729
Copy link

cab-1729 commented Jul 9, 2023

Rofi version (rofi -v)

Version: 1.7.5

Configuration

https://gist.github.com/cab-1729/f7a1c6e56142acc3cb53e21ba77af191

Theme

https://gist.github.com/cab-1729/9ebe8379ca5f7149a4717c3361794bad

Timing report

No response

Launch command

[ ! -f /tmp/window_switch ] && rofi -show windowcd -kb-accept-entry '![64],!Alt+Tab,!Alt+Alt_L' -kb-element-next 'Alt+Tab' -kb-element-prev 'Alt+ISO_Left_Tab' -kb-cancel 'Alt+Escape,Escape' -selected-row 1 -theme-str 'mainbox {children:[listview];}' -no-fixed-num-lines -pid /tmp/window_switch -no-grab-lazy && rm /tmp/window_switch

Step to reproduce

  1. Bind the above command to Alt+Tab in WM or hotkey daemon
  2. Press Alt+Tab
  3. Release Alt

Expected behavior

Window focus switches to different window.

Actual behavior

Rofi does not close on the release of Alt and the entry is not accepted

Additional information

This exact same issue was the topic of now closed #38 which says it has been resolved.
The same behavior is observed as mention in the above issue.

  • Works perfectly is mouse is hovering above rofi area
  • Does not work when mouse is elsewhere

The issue is resolved only if Alt+Tab is pressed more than once. However when pressed only once it shows the same behavior. The release of the Alt key is not detected.

Using wayland display server protocol

  • No, I don't use the wayland display server protocol

I've checked if the issue exists in the latest stable release

  • Yes, I have checked the problem exists in the latest stable version
@cab-1729 cab-1729 added the bug label Jul 9, 2023
@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Jul 9, 2023

Curious, this was posted two week ago #1862

I also cannot reproduce (under i3) what you describe, it seems to work fine (independent of where mouse is)

Are you sure your window manager 'anti steal focus' feature is not stopping the switch?

nevermind I managed to reproduce it, it goes wrong sometimes.

@cab-1729
Copy link
Author

cab-1729 commented Jul 9, 2023

People on #1862 are using the timeout delay. It still doesn't work for me all the time, when it does it creates an massive delay which isn't really an option when it comes to ergonomics.

Using xdotool also seems to be too hacky of a solution that just avoids the underlying problem.

@cab-1729
Copy link
Author

cab-1729 commented Jul 9, 2023

Also I'm testing this on openbox btw.

@sardemff7
Copy link
Collaborator

If I read your config and command line right, you do not specify the -steal-focus switch, which is exactly the fix we added for that
Can you try to add it (to the command line probably, so that it only does so for your Alt-Tab switcher) and see if that works for you?

Probably my fault it never got explicit in #38 or in the doc, but patches for that are appreciated 🙂

@DaveDavenport
Copy link
Collaborator

For me the -steal-focus does not completely fix it.. it works most of the time but not always. (that i was initially fooled thinking it worked).
It seems to be timing related..

@cab-1729
Copy link
Author

cab-1729 commented Jul 9, 2023

Nope. -steal-focus doesn't seem to work at all.

@sardemff7
Copy link
Collaborator

Could you try changing XCB_INPUT_FOCUS_POINTER_ROOT to XCB_INPUT_FOCUS_NONE in https://github.com/davatorium/rofi/blob/1.7.5/source/xcb.c#L1335 and see if that fixes it for you?

If I press Alt-Tab and release immediately I guess I can reproduce, but it’s not exactly usable anyway since I don’t even see where I’m going

@cab-1729
Copy link
Author

Tried it. Doesn't work on my system.

Pressing Alt+Tab and releasing immediately is a valid use case. You might only have two windows active so you already know what it's going to select.

@DaveDavenport
Copy link
Collaborator

FYI: @nick87720z pointed out, its -no-lazy-grab not -no-grab-lazy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants