Skip to content

On-release binding not triggered if was pressed before Rofi launch #687

Description

@sergei-dyshel

Version: 1.4.1 (tags/1.4.1)
Configuration - Default

I'm trying to simulate Alt-Tab behavior, as found in common desktop environments (e.g. Windows or Gnome), using Rofi in i3 WM. Alt-tab is supposed to work this way:
As soon I press Alt-Tab, Rofi window appears. While holding Alt, I cycle to next windows with Tab. When I release Alt I switch to currently selected window.

So far binding Alt-Tab (in i3) to this simple command does the job pretty well:

rofi -show window -kb-row-down 'Alt+Tab' -kb-accept-entry '!Alt_L,!Alt+Tab'

There is, however, an annoying issue: if I don't want to cycle at all, e.g. switch to first (currently selected) window, I'm supposed to release Alt-tab immediately after opening Rofi window, which should trigger kb-accept-entry.

But this doesn't happen! For some reason on-release binding is not triggered. I suspect that it happens because when Rofi started, Alt-Tab was already pressed. So it sees the release of Alt although Alt wasn't pressed. Anyway, I tried going through the relevant commit (67b0ce0), but couldn't figure it out.

I'd like to attempt fixing this on my own so any explanations or code hints are welcome!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions