From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Should FOCUS_OUT_EVENT be ignored for the purposes of input-pending-p? [was: Edebug, with Elisp source in different frame...] Date: Thu, 18 Oct 2018 14:26:28 +0000 Message-ID: <20181018142628.GB3929@ACM> References: <20181017142226.GC4753@ACM> <20181017162253.GD4753@ACM> <20181018110824.GA3929@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1539874437 11028 195.159.176.226 (18 Oct 2018 14:53:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Oct 2018 14:53:57 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 18 16:53:53 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gD9gO-0002kU-Ns for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2018 16:53:52 +0200 Original-Received: from localhost ([::1]:42834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD9iV-00011K-3C for ged-emacs-devel@m.gmane.org; Thu, 18 Oct 2018 10:56:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD9No-0000VQ-J7 for emacs-devel@gnu.org; Thu, 18 Oct 2018 10:34:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gD9Nk-0001pc-4z for emacs-devel@gnu.org; Thu, 18 Oct 2018 10:34:39 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:54756 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gD9Nj-0001oQ-PY for emacs-devel@gnu.org; Thu, 18 Oct 2018 10:34:36 -0400 Original-Received: (qmail 1723 invoked by uid 3782); 18 Oct 2018 14:34:32 -0000 Original-Received: from acm.muc.de (p5B1473D9.dip0.t-ipconnect.de [91.20.115.217]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 18 Oct 2018 16:34:31 +0200 Original-Received: (qmail 10321 invoked by uid 1000); 18 Oct 2018 14:26:28 -0000 Content-Disposition: inline In-Reply-To: <20181018110824.GA3929@ACM> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230476 Archived-At: Hello, Emacs. On Thu, Oct 18, 2018 at 11:08:24 +0000, Alan Mackenzie wrote: > On Wed, Oct 17, 2018 at 16:22:53 +0000, Alan Mackenzie wrote: > > On Wed, Oct 17, 2018 at 14:22:26 +0000, Alan Mackenzie wrote: > > > In a GUI Emacs (26.1 or master), instrument a function for edebug with > > > C-u C-M-x in frame F1. From a different frame, F2, cause this function > > > to be called, thus entering edebug. F2 is still selected. Surely edebug > > > should have selected F1? [ .... ] > edebug-bounce-point has not been working either, but is more difficult > to fix. :-( [ .... ] I have modified edebug-bounce-point with calls to x-focus-frame. This failed to work, because there is a sit-for in the code. keyboard.c receives a FOCUS_OUT_EVENT, and thus input-pending-p returns t. This terminates the sit-for in edebug-bounce-point instantly. This is somewhat similar to the situation in bug #10195. I would like to filter out this event in readable_events (keyboard.c), in the same way that FOCUS_IN_EVENT is filtered out. This filtering appears to be in the same spirit as this amendment: commit eaea02c71ae15d86bb83518796775b6c3c77b71e Author: Eli Zaretskii Date: Sat Jan 31 10:35:26 2015 +0200 Fix while-no-input loops (Bug#19547) src/keyboard.c (kbd_buffer_store_event_hold): Ignore FOCUS_OUT_EVENT and ICONIFY_EVENT for the purposes of breaking while-no-input loops. I propose this change: diff --git a/src/keyboard.c b/src/keyboard.c index 8ea15d3c89..97482e1651 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3344,7 +3344,8 @@ readable_events (int flags) #ifdef USE_TOOLKIT_SCROLL_BARS (flags & READABLE_EVENTS_FILTER_EVENTS) && #endif - event->kind == FOCUS_IN_EVENT) + (event->kind == FOCUS_IN_EVENT + || event->kind == FOCUS_OUT_EVENT)) #ifdef USE_TOOLKIT_SCROLL_BARS && !((flags & READABLE_EVENTS_IGNORE_SQUEEZABLES) && (event->kind == SCROLL_BAR_CLICK_EVENT This allows edebug-bounce-point to work in X, something it hasn't done for a long time, if ever. Before committing this, what sort of testing do I need to do? (I am restricted to GNU/Linux environments). -- Alan Mackenzie (Nuremberg, Germany).