From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Frame shifted upwards upon changing font size Date: Tue, 13 Sep 2022 14:29:00 +0300 Message-ID: <831qsf5x8j.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17068"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 13 13:31:33 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oY48a-0004FY-Uy for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 13:31:33 +0200 Original-Received: from localhost ([::1]:38392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY48Z-0003Lw-Dz for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 07:31:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY46h-0003Lk-Uv for help-gnu-emacs@gnu.org; Tue, 13 Sep 2022 07:29:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53546) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY46h-0008Ii-0u for help-gnu-emacs@gnu.org; Tue, 13 Sep 2022 07:29:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=598KMihznNZGwUK7cD8kxAE2Q2wwZ0/bbQYYQRQaD1g=; b=X9EJYdHA7ldf y6UXWrFxqHEQpb625Gxq8epMTCwVzM4iZsSmLCPAaZkraw/nofcspyPpN13UHnYoY0EEofBhzzuWd XH6N1F4W3UDjJVbamDeLxiUCcxiEGVt69nnboTJI8KHKL5VKbYn8AD6aG9RnMQgNHggkkiCEYjRd6 MgwVz4F2f+G46hgYuB9+YU5KrtvlXPv2+9PgeuK4Qn8RRunbPAsur/3NArMCTp0acVLqG3ZACCI/w psqz+4f2rKruwghpYU3nd3oAxJLochEbjnaUIdUuY541tFyVLFsVwzuvwGAkxngJ/wl2/ZYOLMXWF UpIKosR7pslWxj3NIL1GgA==; Original-Received: from [87.69.77.57] (port=4065 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY46L-0007ci-1w for help-gnu-emacs@gnu.org; Tue, 13 Sep 2022 07:29:32 -0400 In-Reply-To: (message from uzibalqa on Tue, 13 Sep 2022 04:27:17 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139436 Archived-At: > Date: Tue, 13 Sep 2022 04:27:17 +0000 > From: uzibalqa > > > I have a setup that opens emacs at the centre of the screen. > > But then I want to have a specific font size and call > > (set-face-attribute 'default nil :height 160 :weight 'bold) > > This puts the menu-bar outside the screen. What can I do to keep the window at the > center of the screen? I'd try changing default-frame-alist instead of using set-face-attribute. Maybe it will work better. If that doesn't work, change the order between face customizations and setting up the frame coordinates (assuming you do the latter from the init file). In general, what you want is somewhat tricky: Emacs cannot call GUI functions until it has at least one GUI frame, so at best you might see the frame momentarily displayed at the wrong place/with wrong font size before it settles.