From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#37415: Asserting failure setting frame parameters to non-fixnum values in early-init.el Date: Sun, 22 Sep 2019 10:08:53 +0200 Message-ID: References: <83v9tqvrm7.fsf@gnu.org> <9aae1b2e-bb5f-8634-5501-9aaff9f51266@gmx.at> <83imppvl9r.fsf@gnu.org> <14d4a455-254e-fdc2-0b64-791cfb0f7724@gmx.at> <83o8zgtlvq.fsf@gnu.org> <0936d492-c2bc-d4d3-7fcf-272d0fdbe087@gmx.at> <83a7ayss4b.fsf@gnu.org> <7b896377-d546-b428-adba-797ec988c4fa@gmx.at> <83r24aqadz.fsf@gnu.org> <83ftkprfzx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="149632"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37415@debbugs.gnu.org To: Eli Zaretskii , Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 22 10:10:53 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iBwxJ-000coS-BB for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Sep 2019 10:10:53 +0200 Original-Received: from localhost ([::1]:45686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBwxH-0002Vp-GV for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Sep 2019 04:10:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58207) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBwwa-0002Rc-0q for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 04:10:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBwwW-00028d-T6 for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 04:10:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52800) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBwwW-00028T-PD for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 04:10:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iBwwU-00025o-GE for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 04:10:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Sep 2019 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37415 X-GNU-PR-Package: emacs Original-Received: via spool by 37415-submit@debbugs.gnu.org id=B37415.15691397457925 (code B ref 37415); Sun, 22 Sep 2019 08:10:02 +0000 Original-Received: (at 37415) by debbugs.gnu.org; 22 Sep 2019 08:09:05 +0000 Original-Received: from localhost ([127.0.0.1]:33384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBwvZ-00023k-8b for submit@debbugs.gnu.org; Sun, 22 Sep 2019 04:09:05 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:35683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBwvW-000235-O9 for 37415@debbugs.gnu.org; Sun, 22 Sep 2019 04:09:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1569139734; bh=KDwPQWfbITA/0pUvfHNoAIz9TjaGwRwoVm50jVMGBM8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=C3YFUFZ6KKpXutU8YuCXk7cL5ZqLiJ92PJgI3ACppmdg2bbKZjeqQRJZe5+GXeRj+ SqR199yBZ9y9Z4ylLnf4bkQ2Av258K38zC7mf2FhvBggaFPJLohC7R2NL2Uo5y2xm9 HzCU9vwGa3GnvItP2O6up3kqDGWcr+ON7UxuagsA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.90]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mnpnm-1hriP616du-00pJF7; Sun, 22 Sep 2019 10:08:54 +0200 In-Reply-To: <83ftkprfzx.fsf@gnu.org> Content-Language: de-AT X-Provags-ID: V03:K1:CRUksm8YAld4HX/dp+u3C+IgJL1cHY/UmVynBPf37KgcFLf2DE0 og2e1lP5b7wFEeOKK70nyvFtcKw8QHe/gqncFOCkVLFWns1nga/kj76/8HcciwrhI0ZSI1O 8dpjf+Kw1taaciEG7l7N/b1z7KuxFJ+cVAuMu7omsXQfHkytCuKgbofnv8EJsGc4dDGrulQ dHWPihvlcJoy5FaqeCv3w== X-UI-Out-Filterresults: notjunk:1;V03:K0:prSaAN2ZF1E=:EvBsMJdcYNGHioG1JmQ3LM QN3/hPWPqiz6dISsI4byW9Yd+yLfrzBQeY+GfNDGrCqHhR7MabUqlFMmqY7x7uh9pozf6JGO2 zu8C7Q+vFwmrxH9IzvXhPMlZlpf7AXXdeG4Jbil+Ny9XRhS19chDK6i+vnjYTndBLn22ALnE3 rhDQFPD0cuGgXERGSnXZSqF0kUl12E7Q++lI4RqSrVF2oEgQ0vLxLowlUwtfQPR4KERvjkVOT hoNq6xuxFX+Q1Y3clun38TrlQVjence6pq0Y6vN5Uhsi4Gjvo60OUeiTv8NcZcyVErekzDPat ecVT7kBfZaRiAZD4KRb0wx8rBWv2qD6pVuhUNHW8gfL4W4rPSDg2tPGU66lnbaswmkZP8eTyQ pCsVaxuFCuf3J8eMeJwHRLz43MFc+wFrwh65bTf7VYtU4O5Bxj+P3pFoeurce9GTlStAgXMZo 5tKKvY9S1rTnFMrGT7BEyQoelsC3twfJuBGFecYl2ScSzmGPdosXhSIKe0NJdn1ZwtXYR/kfv aGlNpXkfZgjALSR5QGoHSvQyN2lzZnE7AIeZIDRLBdwxQ13dqdYHi+DOmcbvwcFz4L08rsP8w Ufi9zDImNjoUqBg7BG7jTAMe6dKte0xIr1M0F0OWpMRbhCj27kKHF9Y0m+7r7amlRYpuq0N2h fyB03d0NhayG/vmX3bqjujX6nk3MDqLYJfTmoFLbR/f6DB9qRqOBz6qDC8mNgIArIA3rxLHfR iLV6o/FAf6yKPfPeeF/jYZI4TDim+zDIpMaL2fvm0Lnd0ZjD/PwUw3YDBHk1dcPD/XZ624uF 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: 209.51.188.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:166894 Archived-At: >> Before 572fe798cd0a00ad4a9050a7962cf8e8fbcc209b (from 2014-09-30), the computation of left and top >> was done in w32_createwindow: >> >> /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero >> for anything that is not a number and is not Qunbound. */ >> left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); >> top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); >> >> and anything not a number was turned to 0. >> >> In that commit you moved the code to my_create_window and used XINT: >> >> + /* When called with RES_TYPE_NUMBER, x_get_arg will return zero for >> + anything that is not a number and is not Qunbound. */ >> + left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); >> + top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); >> + if (EQ (left, Qunbound)) >> + coords[0] = CW_USEDEFAULT; >> + else >> + coords[0] = XINT (left); >> + if (EQ (top, Qunbound)) >> + coords[1] = CW_USEDEFAULT; >> + else >> + coords[1] = XINT (top); >> + > > Yes, but contrary to the comment, in the case in point we don't get > zero from x_get_arg. Which is why I asked all those questions. Well, now you really asked it ... When called with PARAM Qleft and ALIST Qnil x_get_arg { Lisp_Object tem; tem = Fassq (param, alist); if (!NILP (tem)) ... XSETCAR (XCAR (tail), Qnil); } else tem = Fassq (param, Vdefault_frame_alist); if (NILP (tem)) ... return Fcdr (tem); } returns the cdr of the 'default-frame-alist' entry for 'left' which can be anything. So that comment is wrong and using x_get_arg here probably too. Any reason why we cannot just use f->left_pos my_create_window (struct frame * f) { MSG msg; static int coords[2]; coords[0] = f->left_pos; coords[1] = f->top_pos; if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW, (WPARAM)f, (LPARAM)coords)) emacs_abort (); GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); } like the X build does? martin