ch11ng / exwm

Emacs X Window Manager
2.85k stars 135 forks source link

EXWM and Emacs 29 #873

Open phil-s opened 2 years ago

phil-s commented 2 years ago

Just a heads-up about this: https://lists.gnu.org/archive/html/emacs-devel/2022-05/msg00499.html

I just realized that EXWM must be updated to use the X input extension. Otherwise, it will no longer work with Emacs 29.

I'm not very familiar with its internals, but I would be happy to offer assistance in that direction. The necessary bindings to the input extension should be available if xelb supports a sufficiently new version of XCB.

BS-Labs commented 2 years ago

If there is more information somewhere on exactly what will break and why, I would be more than happy to help out if I can. My X11 knowledge is a little dusty and I've only perused the EXWM/XELB code, but I use both daily and I'd like to continue doing so.

Sbozzolo commented 2 years ago

I have been running on master for a while (right now I am on commit 57b69ff) and I don't see particular problem.

medranocalvo commented 2 years ago

@phil-s: thank you for the heads-up!

@BS-Labs: your help is gladly accepted. To be honest: I don't know what is expected to break. I would look at exwm-input--on-KeyPress-char-mode, exwm-input--on-KeyPress-char-mode and exwm-input--fake-key, though I'm sure I'm missing something.

Something that is often forgotten is that in order to be able to incorporate your changes, you must assign copyright of those to the FSF. If you have not yet done so, you don't have to wait in order to start working but I recommend starting the process as soon as possible (depending on your country of residence it can be very quick).

I must also warn you that there's a lot going on on my private life at the moment, so I have very little time. (I'll of course do my best within my means to help.)

Thank you.

@Sbozzolo: thank you as well for your report!

phil-s commented 2 years ago

I've mentioned this thread to Po Lu, but it turns out that he doesn't have a GitHub account, and so won't be able to discuss the issue here. I'm not an EXWM user myself, so I'm not intending to stick around as a go-between, so I think someone more directly involved should contact him by email if further input is needed. I won't show his email address here, but you would be able to find him via the emacs-devel mailing list.

He had this to add to his original comments:

The immediate problem is that selecting for core input on the outer Emacs window and/or the inner window will no longer work. EXWM must be modified to select for and handle the corresponding extension events, because as long as a client such as Emacs is interested in input extension events on a window, the X server will not deliver the corresponding core events to clients that have selected for them, such as EXWM.

This probably means exwm-input--on-KeyPress won't get KeyPress events, exwm-input--on-ButtonPress won't get ButtonPress events from the Emacs window, and so on. They should be modified to handle GenericEvents, and XI_KeyPress and XI_ButtonPress inside that.

The input extension doesn't let you reliably grab all devices (or mix core grabs with extension grabs), so all GrabKey and GrabButton requests should be replaced with their input extension counterparts, and always correspond to the master device which generated the event which caused the grab.

The input extension also specifies that each master or floating slave device can have its own pointer focus, and that there can be multiple pointers on each screen, so EXWM will have to be modified to track focus on a per-device basis.

The protocol of the input extension (and the format of the events) can be found here: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/master/specs/XI2proto.txt

madnificent commented 2 years ago

@BS-Labs Are you still on the latest master? What commit are you on now? I stopped upgrading when this message appeared as I don't see myself fixing it.

gdindi commented 2 years ago

Hi, I am always on master and I don't have any particular problem other than the one I reported here https://github.com/ch11ng/exwm/issues/771#issuecomment-1173406250. I have been having this issue for some months now, so it does not seem related to the OP's message.

progfolio commented 3 months ago

Is this still relevant? Everything is working for me on master (Emacs 30.0.5).

Stebalien commented 3 months ago

I haven't seen it but I'm guessing this is only an issue if you use said extensions/features.

IMO, we should close this issue and let users file specific issues if/when they hit a bug.