d12frosted / homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
MIT License
2.35k stars 181 forks source link

`--with-xwidgets` changes behavior of ESC in GUI #322

Closed winmillwill closed 1 month ago

winmillwill commented 3 years ago

I'm not heartbroken about this since, for my browser needs, the feature just isn't there yet, but I was surprised that evil escape just stopped working in the GUI. I was still able to use ESC in the terminal, ^[ in the GUI would work right, but maybe something about dipping into X made emacs go "oh, it's Linux" and stop seeing ESC? FWIW, karabiner event viewer shows HID code 41 for both my ctrl-press -> esc remap and for the "real" esc key.

d12frosted commented 3 years ago

Curious issue. And I still don't know the answer. Maybe there are other xwidgets users who can help? @agzam as far as I remember you were the most active user of this feature 😸 Do you have this issue?

agzam commented 3 years ago

I did notice - ESC key sometimes does strange things, and I'm not sure if that's core, xwidgets, Spacemacs, or my local config issue. Like for example:

matteha commented 2 years ago

Also having this issue which makes it unusable unfortunately (emacs 28 plus native comp + xwidgets, on M1 Monterey, Doom emacs) as esc stops working intermittently. Is this related to installing with xwidgets?

agzam commented 2 years ago

xwidget has this bug (I'm not sure, this might be it https://github.com/veshboo/emacs/issues/4). The only workaround I have found, and it looks like works for me - you need to click somewhere within the frame manually, using the mouse (I know, I hate that too). All my attempts to resolve this with elisp: focusing programmatically, selecting objects, emulating mouse-clicks, using timers - they all were unsuccessful.

d12frosted commented 2 years ago

@agzam thanks for the link. Looks like there is proposed solution, it's just no one brought it here.

I've no ability to test it myself, so the best course of action would be if someone tests this patch. I can guide you on this 😸 So if anyone wants to contribute this possible fix to Emacs+, just ping me and I will help with that. Maybe @matteha @agzam or @winmillwill ?

Dima-369 commented 11 months ago

I also have this annoying behavior when the Escape key is inaccessible after interacting with a xwidget.

you need to click somewhere within the frame manually, using the mouse (I know, I hate that too)

For me, this is also the only workaround to fix this which isn't too nice.


So I just tested the patch in https://github.com/veshboo/emacs/issues/4 on emacs-plus@30 on macOS 14.0 - and it works flawlessly. The Escape key behavior is not modified anymore.

I'd love to see this merged here, but maybe someone else can test this as well? 🙂

Dima-369 commented 11 months ago

and it works flawlessly

The patch only works for the "escape" key, but I've noticed that the arrow keys are also stuck on interacting with an XWidget. And they can only be fixed when you click inside the Emacs window manually.

The linked patch does not help with that.

d12frosted commented 1 month ago

I am planning to remove --with-xwidgets option as I do not maintain the patch. So I can't provide any support. Plus there is no real owner of this patch at this point, so I see no point in keeping this issue open.