From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.help Subject: Re: Frame shifted upwards upon changing font size Date: Tue, 13 Sep 2022 13:53:00 +0000 Message-ID: References: <831qsf5x8j.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25615"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , help-gnu-emacs@gnu.org To: uzibalqa Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 13 15:55:03 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 1oY6NS-0006T8-OT for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 15:55:02 +0200 Original-Received: from localhost ([::1]:48692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY6NR-0001zW-Of for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 09:55:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY6LZ-0001uY-EX for help-gnu-emacs@gnu.org; Tue, 13 Sep 2022 09:53:05 -0400 Original-Received: from heytings.org ([95.142.160.155]:37506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY6LX-0000g2-Tx; Tue, 13 Sep 2022 09:53:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1663077181; bh=Q4Or43SHtwxTEQphcC6yChKI0lgR3HPR6n1KjfRhaZ8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=nXBId+50L0lJcQrxH/hs1m1rchhEJV8fodJnUZ0V90A3+JvGHmNm2fUPiAjudkYD0 RmMiyEwA823HaP9J28f5AHQfGzr7Z+6JJUBjcIxSy7XsWJwEJyVv+DXRmwZlWHOwgl JLJD/E7lIBxYsH7wwoe5yPnq4Ee2MiF3k13VeLbhu7VdFpViJqF+Z+PorP0I9lVUYa WuYzh10ctW+NzL+TN7UiqV+hGdOZ1+lejNboJ0GVC6moVo3T/5kAoNcb5t0KzK1yY/ ILXNQ2zi79JjMmI7aOpIt4ht2+4GbBVFBHLtLw6KHZM6yYq7vkDxM5ehjGvnVAq1+N fzUTeHLxdO7xg== In-Reply-To: Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:139447 Archived-At: >> (defun frame-center (&optional frame display) >> (interactive) >> (set-frame-position >> frame >> (/ (- (display-pixel-width display) (frame-pixel-width frame)) 2) >> (/ (- (display-pixel-height display) (frame-pixel-height frame)) 2))) > > I have different monitors with different sizes, and the function is > transferring the frame to a different monitor. > In that case you need to use display-monitor-attributes-list to get the size of the appropriate monitor.