unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mohammad Toossi <mohammad@toossi.info>
To: 21796@debbugs.gnu.org
Subject: bug#21796: emacs not responding to keyboard events
Date: Sat, 28 Nov 2015 00:02:04 -0800	[thread overview]
Message-ID: <CABfgjLGnFPvYEm6xSXEiz95bD87id_BFm+-zPb-0gKe_iFu1mg@mail.gmail.com> (raw)
In-Reply-To: <86bnbfx5v3.fsf@sungevity.com>

[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]

I am most likely affected by the same issue: when emacs is launched to
compose a git commit message, it sometimes ignores all keyboard input, but
mouse input works normally.  I am using Emacs 24.5.1, Ubuntu 14.04, and I3
WM.

Even more surprisingly, emacs responds to X KeyPress events sent to it
through "xdotool", but not through the real keyboard.  Also, "xev"
indicates that emacs is receiving all KeyPress events and just dropping
them internally.

After spending some time attaching GDB and stepping through code, I have
found that x_filter_event() is the point in which the KeyPress event gets
dropped.  In a good emacs instance, event_handler_gtk receives the event
and passes it on to handle_one_xevent.  In a bad instance,
event_handler_gdk still receives the event but never passes any KeyPress
event to handle_one_xevent.  In bad instances, x_filter_event always
returns true for real key presses, but returns false for fake key presses
from xdotool.

My best guess at this point is that the issue is something along the lines
of [1].  Slowing down the system increases the likelihood of this race
condition(?) happening.

To take it even further, I used xscope to intercept the emacs messages
to/from X, and put a breakpoint on SYNC-Request messages.  Stepping through
the subsequent X messages one by one triggered the bug (1 out of 1 times)
further suggesting that this is a timing issue.

I'm skipping a lot of detail here in order to keep this short.  Feel free
to ask me for more specifics.

[1] XIM SYNC_REPLY not sent when switching input contexts <
https://bugs.freedesktop.org/show_bug.cgi?id=7869>
[2] http://ftp.x.org/pub/individual/app/xscope-1.4.1.tar.gz

[-- Attachment #2: Type: text/html, Size: 2040 bytes --]

  parent reply	other threads:[~2015-11-28  8:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-31  0:02 bug#21796: 25.0.50; exiting ediff can leave Emacs unresponsive to keyboard input Sean McAfee
2015-10-31  7:34 ` Eli Zaretskii
     [not found]   ` <86twolu3xg.fsf@sungevity.com>
2015-11-16 20:42     ` Eli Zaretskii
2015-11-16 21:48       ` Sean McAfee
2015-11-28  8:02 ` Mohammad Toossi [this message]
2016-03-16 14:54 ` bug#21796: 24.5; " johannes.muelmenstaedt
2016-07-11 17:57 ` bug#21796: Mark Grosen
2017-06-23 15:47 ` bug#21796: Jonathan Doull
2017-06-23 15:55   ` bug#21796: Noam Postavsky
2017-06-23 16:13     ` bug#21796: Jonathan Doull
2017-06-23 17:23   ` bug#21796: martin rudalics
2017-06-23 17:54     ` bug#21796: Jonathan Doull
2017-06-24  8:39       ` bug#21796: martin rudalics
2017-06-23 19:03 ` bug#21796: exiting ediff can leave Emacs unresponsive to keyboard input Noam Postavsky
2017-06-24  8:39   ` martin rudalics
2017-06-28 18:37     ` Jonathan Doull
2017-06-29  7:17       ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABfgjLGnFPvYEm6xSXEiz95bD87id_BFm+-zPb-0gKe_iFu1mg@mail.gmail.com \
    --to=mohammad@toossi.info \
    --cc=21796@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).