From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#23924: [PATCH] Post AppDefined events from the main thread ONLY (bug#23934) Date: Wed, 20 Jul 2016 22:09:26 +0100 Message-ID: <20160720210926.GA16639@breton.holly.idiocy.org> References: <6629E4B5-5D34-4840-B0A1-A62BA025C472@play-bow.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1469049030 17865 80.91.229.3 (20 Jul 2016 21:10:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2016 21:10:30 +0000 (UTC) Cc: 23924@debbugs.gnu.org To: Bob Halley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 20 23:10:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bPyku-00041G-Sw for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2016 23:10:13 +0200 Original-Received: from localhost ([::1]:37131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPykt-0008Rc-Vd for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2016 17:10:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPyko-0008Pq-1a for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 17:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPykk-0002UM-Sj for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 17:10:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPykk-0002UH-P4 for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 17:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bPykk-0007cu-IJ for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 17:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jul 2016 21:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23924-submit@debbugs.gnu.org id=B23924.146904897629277 (code B ref 23924); Wed, 20 Jul 2016 21:10:02 +0000 Original-Received: (at 23924) by debbugs.gnu.org; 20 Jul 2016 21:09:36 +0000 Original-Received: from localhost ([127.0.0.1]:59034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPykK-0007c9-53 for submit@debbugs.gnu.org; Wed, 20 Jul 2016 17:09:36 -0400 Original-Received: from mail-wm0-f68.google.com ([74.125.82.68]:35837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPykJ-0007bw-0R for 23924@debbugs.gnu.org; Wed, 20 Jul 2016 17:09:35 -0400 Original-Received: by mail-wm0-f68.google.com with SMTP id i5so8721200wmg.2 for <23924@debbugs.gnu.org>; Wed, 20 Jul 2016 14:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=WbgcnTldlb9m01tNdL9WyqXfTVX57TY69rKcpZp/ICo=; b=o5lGdhhxNFMZhKglBSSdnYeyinJLnwEWxHdRmhtjsR4bfzCiX6FIr4FzpdbW61mFc/ u5BMVakUAHFR9IUDggB6ccxVzBjOATHVn3cZo4NcAjpILJBe7a+su7LXVfjLzKKNCWvu Wjx6DWSpUJO0j6yYhM4FzF3C7q3zK3Jt3HmGrhyXhcrdWqFBSBi4/R0R/X+GgRQl8yF2 btbvfwibNEx41N2+FhUg1FDxOzEkkWjFiEMVp99InGaQLoWlb16A40X96fCdZtMI/ybL FHTqUGkrYjJ6JIOnKi3WHbwIjzdZOgVBOOTVrAtSudaPQrM1Ox6tVjDw6GvV3YwgwLmG ROrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=WbgcnTldlb9m01tNdL9WyqXfTVX57TY69rKcpZp/ICo=; b=KoMnLSabBLku39gmiyeUYAjKRBuvS50scL4wG+tSrpFkYjLAbSE7muxTEKuT99R3PT S+FpA/oPQuuvqAsTsvFHzzcR8V4s0HOaQIQYqR7xB+83Fauenk3Jms/YR3rnqy6ZBQPW RUlD6cKbfmvExB/JOP3pdFuTc29oy33GxrmK+HZsFq0/VMNM1MVipk+mNUarw7CFOh06 mleKK5JfBPrcOqDP3JzWpqusdcCCx+r86lmLLe6eEChSkOc1aGpI/8YzbXNMaFeoBrvw GF6Z1eyaUSBsXr2jQ4XVYme2aKMgxw5UWMFED7MkinV6iVFYHjOaar2EoH43CG6bQzr7 Wuxw== X-Gm-Message-State: ALyK8tJ+UuEb4R0O94GA1q9qtZuu0xhl5ttXKJN6p4hx/3dm88QhjVfAew+gpbOOaDQ0og== X-Received: by 10.194.145.103 with SMTP id st7mr3351891wjb.27.1469048969137; Wed, 20 Jul 2016 14:09:29 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-3c58-f213-3cd9-9a60.holly.idiocy.org. [2001:8b0:3f8:8129:3c58:f213:3cd9:9a60]) by smtp.gmail.com with ESMTPSA id us7sm3000514wjc.13.2016.07.20.14.09.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jul 2016 14:09:28 -0700 (PDT) Content-Disposition: inline In-Reply-To: <6629E4B5-5D34-4840-B0A1-A62BA025C472@play-bow.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121338 Archived-At: * src/nsterm.h: Make nextappdefined var not just GNUStep. * src/nsterm.c (ns_send_appdefined, sendFromMainThread): Remove GNUStep --- src/nsterm.h | 2 +- src/nsterm.m | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nsterm.h b/src/nsterm.h index 862ff2e..3d8b1a1 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -380,9 +380,9 @@ char const * nstrace_fullscreen_type_name (int); #endif #ifdef NS_IMPL_GNUSTEP BOOL applicationDidFinishLaunchingCalled; +#endif @public int nextappdefined; -#endif } - (void)logNotification: (NSNotification *)notification; - (void)antialiasThresholdDidChange:(NSNotification *)notification; diff --git a/src/nsterm.m b/src/nsterm.m index 8da2ffe..dcc1e87 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3927,8 +3927,8 @@ overwriting cursor (usually when cursor on a tab) */ { NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_send_appdefined(%d)", value); -#ifdef NS_IMPL_GNUSTEP // GNUstep needs postEvent to happen on the main thread. + // Cocoa needs nextEventMatchingMask to happen on the main thread too. if (! [[NSThread currentThread] isMainThread]) { EmacsApp *app = (EmacsApp *)NSApp; @@ -3938,7 +3938,6 @@ overwriting cursor (usually when cursor on a tab) */ waitUntilDone:YES]; return; } -#endif /* Only post this event if we haven't already posted one. This will end the [NXApp run] main loop after having processed all events queued at @@ -5551,12 +5550,10 @@ - (void)timeout_handler: (NSTimer *)timedEntry ns_send_appdefined (-2); } -#ifdef NS_IMPL_GNUSTEP - (void)sendFromMainThread:(id)unused { ns_send_appdefined (nextappdefined); } -#endif - (void)fd_handler:(id)unused /* -------------------------------------------------------------------------- -- Hi Bob, can you try this patch instead. Rather than remove the check, I’m now trying to force it to run in the main thread, since that’s what your original error was complaining about. I’ve tried looking for more information on this bug in 10.10, and am drawing a blank. I’m beginning to suspect it’s a bug in Emacs’s event handling code rather than OS X. -- Alan Third