From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Perry E. Metzger" Newsgroups: gmane.emacs.devel Subject: Re: Weird problem with inital frame sizing Date: Wed, 12 Sep 2018 13:01:13 -0400 Message-ID: <20180912130113.7bcb9df6@jabberwock.cb.piermont.com> References: <20180912103723.0999377c@jabberwock.cb.piermont.com> <20180912113538.645f02f7@jabberwock.cb.piermont.com> <87h8iu90q6.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1536771562 27550 195.159.176.226 (12 Sep 2018 16:59:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2018 16:59:22 +0000 (UTC) Cc: Noam Postavsky , Emacs developers To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 12 18:59:18 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 1g08U2-00074V-9p for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2018 18:59:18 +0200 Original-Received: from localhost ([::1]:37286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g08W8-0001CI-Pf for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2018 13:01:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g08W2-0001Bq-OC for emacs-devel@gnu.org; Wed, 12 Sep 2018 13:01:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g08Vy-0002iB-Uq for emacs-devel@gnu.org; Wed, 12 Sep 2018 13:01:20 -0400 Original-Received: from hacklheber.piermont.com ([2001:470:30:84:e276:63ff:fe62:3400]:41590) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g08Vx-0002gY-0d for emacs-devel@gnu.org; Wed, 12 Sep 2018 13:01:17 -0400 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id 35EE1248; Wed, 12 Sep 2018 13:01:14 -0400 (EDT) Original-Received: from jabberwock.cb.piermont.com (jabberwock.cb.piermont.com [10.160.2.107]) by snark.cb.piermont.com (Postfix) with ESMTP id 119B32DF950; Wed, 12 Sep 2018 13:01:14 -0400 (EDT) In-Reply-To: <87h8iu90q6.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:30:84:e276:63ff:fe62:3400 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:229719 Archived-At: On Wed, 12 Sep 2018 17:47:29 +0200 Robert Pluim wrote: > "Perry E. Metzger" writes: >=20 > > On Wed, 12 Sep 2018 10:50:05 -0400 Noam Postavsky > > wrote: =20 > >> On 12 September 2018 at 10:37, Perry E. Metzger > >> wrote: > >> =20 > >> > Thinking that this might be some sort of weird race condition > >> > during initialization, I put a "(sleep-for 1)" into my .emacs > >> > just before the code that sets everything, i.e., before all my > >> > "set-face-attribute" and "default-frame-alist" manipulation. > >> > When I do this, the frame pops up in its initial size and > >> > configuration, and then after the sleep ends, the size of the > >> > default frame adjusts and is consistently correct. > >> > > >> > Can anyone guess what might be going wrong, and how we might > >> > fix this correctly? =20 > >>=20 > >> Does changing x-wait-for-event-timeout help (or hurt)? > >>=20 > >> Possibly doing your manipulation in after-make-frame-functions > >> would be the correct fix. =20 > > > > It would seem to me that requiring users to change their default > > font in that way rather than just in their .emacs file is a bit > > heavyweight. It's certainly not documented, and hasn't always been > > needed in the past... =20 >=20 > This might be , > which I haven't gotten around to tracking down fully. It=CA=BCs very > window-manager dependent though. I found that starting emacs with > '--no-x-resources' made the issue go away, which points to a race > condition in the initial frame setup. emacs --no-x-resources doesn't seem to fix it for me. That said, this is clearly a race condition in the initial frame setup. Setting x-wait-for-event-timeout to 0.5 "fixes" the problem. The problem is apparent at the default value of 0.1. This is quite frustrating and I want it fixed badly so I'm willing to do whatever will be of assistance to fix this. I've had on and off issues with race conditions in the initial frame setup, both on X11 and on MacOS/Quartz for years. I'd like them extirpated once and for all. Perry --=20 Perry E. Metzger perry@piermont.com