ch11ng / exwm

Emacs X Window Manager
2.86k stars 137 forks source link

Changes in Emacs on `master` break EXWM-XIM #914

Open mattbeshara opened 1 year ago

mattbeshara commented 1 year ago

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6f940c6a1183dd1660f35e6c82d33183a6892cb4

This commit in Emacs changes how it initialises XIM support, and attempting to use EXWM-XIM with a build of Emacs from after this commit was merged results in Emacs hanging after the last couple of expressions in exwm-xim--init are evaluated.

A workaround is to disable XIM support in Emacs at compile time, however this is not ideal. It would be more convenient if there was a way to disable Emacs' built-in XIM support at runtime, and this was done in exwm-xim--init. I haven't had time to really dig into that commit on Emacs yet, so I don't know if this is currently possible or if it would require a change to Emacs itself as well.

Sbozzolo commented 1 year ago

It would be great to report this to emacs-devel so that we can get advice on how to fix the issue.

medranocalvo commented 1 year ago

Thank you for bringing this up, @mattbeshara.

I perused the commit. It seems that XIM is now enabled/disabled per Emacs frame or Emacs terminal (not sure), instead of globally. This should make no difference to us. Apparently, the commit fixes XIM initialization. It's possible that Emacs failed to initialize XIM before, leading prevented the issue we now see.

exwm-xim consists of using Emacs as the X input method server. One could imagine Emacs kind-of deadlocking when trying to use XIM.

I see no way to configure XIM other than using the X resource: https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html#index-XIM-_0028X-resource_0029 (see https://www.gnu.org/software/emacs/manual/html_node/emacs/Resources.html as well). Please, check whether XIM is enabled when launching Emacs as follows (not tested):

emacs --xrm='Emacs.useXIM: false'

I wonder what a solution looks like. I think that what we need is:

As to @Sbozzolo's proposal, I'd recommend instead to report it as a bug report (M-x report-emacs-bug, then copy the relevant parts to your mailer).

mattbeshara commented 1 year ago

Thanks @medranocalvo, putting Emacs.useXIM: false into my .Xresources seems to obviate the need to turn XIM support off at compile time. I’m happy with this means of fixing the problem, so I’ll close this issue.

medranocalvo commented 9 months ago

I'm reopening this, as we should try to make exwm-xim work out-of-the box without special configuration.