From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: Re: Frame shifted upwards upon changing font size Date: Tue, 13 Sep 2022 13:57:13 +0000 Message-ID: References: <831qsf5x8j.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29653"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , help-gnu-emacs@gnu.org To: Gregory Heytings Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 13 16:10:18 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 1oY6cD-0007MI-JJ for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 16:10:17 +0200 Original-Received: from localhost ([::1]:45852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY6cC-0000hP-Kt for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 10:10:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY6Po-0006Ur-Gt for help-gnu-emacs@gnu.org; Tue, 13 Sep 2022 09:57:28 -0400 Original-Received: from mail-4319.protonmail.ch ([185.70.43.19]:49101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY6Pj-0001N6-7H; Tue, 13 Sep 2022 09:57:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1663077440; x=1663336640; bh=C2nWJ7MqcfZFWJDXtaK6cM4eF7WA0IHOFsEsQCYw9cc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=MblvTjuyYNj2CMFekYIvj2c+k7+J6/tdPxon8WQN3mB0rtFqSj70/5PsCINnnDwn3 +IHiRYuMKyz5ZJPmY4AS3ahzNMWjtm3zkYeGQCGa3PNwt+dT1AhSgmR2JihjzAJJBP l+0rFpwS9dtel4Wlgzlu7wN6EehNa3XEbdGt6UcQQLqyxTO7ZuR3OXycS4ZOosh7uH ULXVKc7ckj1IN7+Di8tfBZQ+rKJM6TcTj3oLg+AX2OFJFbMs+hNzBuNWJVSvy9VLp7 hSxYC7mLPnqod7Ui1zn7Z4AsxqF5yi/Smnzi/dzlxvSSud7B0MM1fIKGbnvkIurgRL hl5bTJAJO5Uog== In-Reply-To: Feedback-ID: 52887082:user:proton Received-SPF: pass client-ip=185.70.43.19; envelope-from=uzibalqa@proton.me; helo=mail-4319.protonmail.ch 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:139448 Archived-At: Sent with Proton Mail secure email. ------- Original Message ------- On Tuesday, September 13th, 2022 at 1:53 PM, Gregory Heytings wrote: > > > (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))) > >=20 > > I have different monitors with different sizes, and the function is > > transferring the frame to a different monitor. >=20 >=20 > In that case you need to use display-monitor-attributes-list to get the > size of the appropriate monitor. I get (((geometry 1080 1152 1366 768) (workarea 1080 1152 1311 768) (mm-size 344 = 194) (frames #) (source . "Gdk"))=20 ((geometry 0 0 1080 1920) (workarea 0 0 1080 1920) (mm-size 477 268) (frame= s #) (source . "Gdk"))) What would be the way forward?