Alacritty weird focus behaviour

I’m very new to Nix and NixOS, and loving it so far. I feel like I’m in the future :grin: .

That said, I’ve run into some issues that I haven’t seen on other Linux distros. In particular, Alacritty has some weird behaviour regarding focus. I use Rofi to launch applications using super+space, but if I run this from alacritty, all keystrokes go to Alacritty. However, if I open another application and launch Rofi from there, the keystrokes go to Rofi as expected.

I also have a strange issue where the cursor is invisible in Alacritty until I open another application. This issue does seem to have some traction on the internet, and I found a couple of Github issues that seemed helpful, but don’t directly relate to the keystroke issue:

Perhaps these are related to the keystroke issue?

My desktop environment is pretty much unmodified from the default gnome NixOS 22.05 installation, but happy to provide more details (I’m not sure exactly what information is relevant). Any advice is much appreciated :grin:

Not only this, but the cursor can stay unchanged when moving from another application to Alacritty, so you wind up with a Firefox pointing- or grabby-hand for example.

Do you have click-to-focus or one of the focus-follows-mouse modes?

Hmm, I’m not 100% sure what you mean, but I think “click-to-focus”. If I have two windows side-by-side, click into window A, then hover my mouse over window B, then start typing, the keystrokes go to window A.

Is that what you were asking?

Yep. I have the latter, so it seems it’s not an artefact of that (ie something tied to the click event it’s not getting)

Does the rofi problem happen with other terminal emulators, or only with Alacritty?

You might get some insight if you run rofi from the (Alacritty) command line instead of using your super+space key binding. There are lots of command-line options for rofi documented in the man pages.