unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Jonathan Ganc <jonganc@gmail.com>, 26104@debbugs.gnu.org
Subject: bug#26104: 26.0.50; In Ubuntu, having mouse over other frame cause Alt key to produce a <switch-frame> event
Date: Wed, 05 Apr 2017 08:58:23 +0200	[thread overview]
Message-ID: <58E4958F.5040200@gmx.at> (raw)
In-Reply-To: <1d493e40-8d0d-a393-081f-55e32bef0857@gmail.com>

 > It should be noted that I don't know that actually moving the mouse
 > plays a role here. As long as the mouse cursor is over the other
 > frame, the issue happens, even if I don't actually move it. Setting
 > track-mouse doesn't make a difference.

‘yank-pop’ by itself does not query the mouse position so "pressing the
Alt key produces a <switch-frame> event" as you said earlier does not
describe what really happens.  Someone else must have changed
`last-command' to `switch-frame' and it would be essential to find out
who.  And, as a furthe clue, the event must have come from a mouse move
since according to "the mouse is positioned over the other frame" this
is the only thing you do in between ‘yank’ and ‘yank-pop’ and if you do
not move the mouse in between them the M-y succeeds.  Or am I missing
something?

Now a frame switch triggered by mouse movement can only occur on
behalf of two underlying processes:

(1) The "window system" when tracking the mouse pointer tells us that it
     has crossed an edge from (focus-out-hook, mouse-leave-buffer-hook)
     or to (focus-in-hook) one of our window system windows.

(2) Emacs itself is tracking the mouse via `track-mouse' or something
     the like.

As for (1) I mentioned these hooks because they would allow you to put a
function on them in order to track what triggers your `switch-frame'
event.  As for (2) you would have to find all users/callers of
`track-mouse', inject some extra code in it to track its use and
recompile/reevaluate the users.

Simple put some code there that beeps like

(add-hook 'focus-in-hook 'ding)

and look what's happening.

All this would enable you to find out who generates a switch-frame event
although your mouse movements were apparently innocuous enough to never
motivate such an insertion.  If and when you find out the reason of that
insertion, we might be able to try to (optionally) prevent it.

 > I think trying to figure out where the switch-frame actually gets
 > triggered is a good idea. It looks like I'm going to have to try doing
 > some serious spelunking (at least for me)! As I think you suggest, I
 > want to try to figure out what is getting sent by xwindows vs what is
 > being generated by emacs itself.

If the above approach is inusfficient we indeed might have to add some
extra code to make_lispy_switch_frame in order to find out what happens.
In that case you have to be able to build Emacs on your machine.

martin






  reply	other threads:[~2017-04-05  6:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15  3:25 bug#26104: 26.0.50; In Ubuntu, having mouse over other frame cause Alt key to produce a <switch-frame> event Jonathan Ganc
2017-03-17  7:19 ` martin rudalics
2017-03-18  1:04   ` Jonathan Ganc
2017-03-18  8:19     ` martin rudalics
2017-04-01  9:53       ` martin rudalics
2017-04-04  0:59         ` Jonathan Ganc
2017-04-05  6:58           ` martin rudalics [this message]
2017-04-07  3:56             ` Jonathan Ganc
2017-04-07  5:56               ` martin rudalics
2017-04-07 15:27                 ` Jonathan Ganc
2017-04-08  8:59                   ` martin rudalics
2017-04-08 22:42                     ` Jonathan Ganc
2017-04-09  6:37                       ` martin rudalics
2017-04-15  9:41                         ` Jonathan Ganc
2017-04-15 14:50                           ` martin rudalics
2017-04-15 15:11                             ` Eli Zaretskii
2017-04-15 19:39                               ` martin rudalics
2017-04-15 20:23                                 ` Jonathan Ganc
2017-04-16  7:15                                   ` martin rudalics
2017-04-15 20:33                                 ` Jonathan Ganc
2022-04-21 15:15                           ` Lars Ingebrigtsen

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=58E4958F.5040200@gmx.at \
    --to=rudalics@gmx.at \
    --cc=26104@debbugs.gnu.org \
    --cc=jonganc@gmail.com \
    /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).