From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrii Kolomoiets Newsgroups: gmane.emacs.bugs Subject: bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float Date: Tue, 09 Feb 2021 19:46:53 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1081"; mail-complaints-to="usenet@ciao.gmane.io" To: 46406@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 09 18:50:58 2021 Return-path: Envelope-to: geb-bug-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 1l9XA9-0000A3-LH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 18:50:57 +0100 Original-Received: from localhost ([::1]:43550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9XA8-0006O4-KU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 12:50:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9X7K-0003ym-RG for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 12:48:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9X7K-0003Yw-KC for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 12:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9X7K-0006sj-Jb for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 12:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrii Kolomoiets Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Feb 2021 17:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46406 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161289282526384 (code B ref -1); Tue, 09 Feb 2021 17:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Feb 2021 17:47:05 +0000 Original-Received: from localhost ([127.0.0.1]:54504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9X6P-0006rS-3T for submit@debbugs.gnu.org; Tue, 09 Feb 2021 12:47:05 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:38932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9X6M-0006r9-HC for submit@debbugs.gnu.org; Tue, 09 Feb 2021 12:47:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9X6K-0003Pp-SA for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 12:47:02 -0500 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:42285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9X6J-0003HP-BX for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 12:47:00 -0500 Original-Received: by mail-lf1-x132.google.com with SMTP id f23so12605093lfk.9 for ; Tue, 09 Feb 2021 09:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=rfSqY4d+vzrbfdij2QOQpfAPu3wTAv+fUjwh8SZGyb8=; b=tlcimgFlh9Wg1b9IEjunR2FCRVPipEm/hzX9MDTbRjyvN3lbq0dtwOLVN0rPHP3Zae CtPyRYFnJIZ7MKlPftZv4XJZ7kothrn4aLPyXmhtPJ5EAY//rUblj37RbOT1zp1pRovv g9CyiTyIk89frrDpR8E4pDYln1zIJsssvcI9clcnMHlsRrj6GB/rhclCLU0Ib9h9VfbG ig2FUYspmx1hWqqIdpB0x/u4whM6RcEyRfRy3xjqzKdQuV6fS4HYEMTQkZFbI7rZfq96 okWzQ5kdoqhpnwMBkv3M107LTHcDO78AAqM9ew2yJrSH7vY31CnfGmFZid1cEq4LyBBz bPOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=rfSqY4d+vzrbfdij2QOQpfAPu3wTAv+fUjwh8SZGyb8=; b=fCpCT+UDbl0tdvc4G9g2p7+RRjs77Fle6WOFeGzWE+iOcSwVsOj1RYHKVpLzDRe8bv 655MDPKQe+n7nCctzC1meqyJnVkZKzKVtjPAhiXGsfubIaakRsQHkZVo+7UiGzsg9ljp 1xGdQTQ10nraDaulJXTnLXYqvajO838mZ0sQAK0vFUaaVM4INk6KhaWcD3NIy46kmKUm hKjmag6KN9f+CUssx2OdOmEhySX5uIODcf8BKLUH8bZsjNXqBeBnmdHaTjEvf6smGA+/ QmdPPnhefGMJZVxo6PveebQBdGcnKPSk/O0l+/aWwqKgp2bMRm0vR8u4k6+wRfD0uyqA kovA== X-Gm-Message-State: AOAM531MPBbUDgyqvCTHSFMSQjjeoqNV77I+u2qjs7qT5+UTeXpjkDk9 cI8meguKaZg8fwdQeAWyIBv0laWMxyoYnw== X-Google-Smtp-Source: ABdhPJyXsF3riaTs+xTMQ24CBkulMTgBpSFClKqR174O68LaheUaaTTSqhugMcAvAGYjUmOAoM/74A== X-Received: by 2002:a05:6512:376f:: with SMTP id z15mr13896158lft.59.1612892816216; Tue, 09 Feb 2021 09:46:56 -0800 (PST) Original-Received: from muffinmac ([91.206.110.197]) by smtp.gmail.com with ESMTPSA id e16sm1363675ljn.105.2021.02.09.09.46.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:46:55 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=andreyk.mad@gmail.com; helo=mail-lf1-x132.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199706 Archived-At: --=-=-= Content-Type: text/plain To reproduce this you need at least one secondary monitor. 1. emacs -Q 2. Move the frame to the secondary monitor 3. M-: (modify-frame-parameters nil '((left . .5) (top . .5))) frame is moved to the main monitor 4. Move the frame to secondary monitor again 5. M-: (modify-frame-parameters nil '((width . .5) (height . .5))) frame size is half of the main monitor instead of the secondary one In my case the 'display-monitor-attributes-list' function returns these attributes: (((geometry 0 0 1440 900) (workarea 0 25 1440 875) ...) ((geometry -254 900 1920 1080) (workarea -254 900 1920 1055) ...)) Attached patch make the frame position and size ratios calculations related to the monitor on which the frame is. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-frame-monitor-in-frame_float.patch >From 28192ba6ea2769c11bfce1dc4b184a15e8c09248 Mon Sep 17 00:00:00 2001 From: Andrii Kolomoiets Date: Tue, 9 Feb 2021 19:31:50 +0200 Subject: [PATCH] Use frame monitor in frame_float On handle frame size and positon ratios, use the attributes of frame monitor instead of main monitor. * src/frame.c (frame_float): Use frame monitor attributes. --- src/frame.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frame.c b/src/frame.c index 635fc94560..a62347c1fb 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3890,7 +3890,7 @@ frame_float (struct frame *f, Lisp_Object val, enum frame_float_type what, Lisp_Object frame; XSETFRAME (frame, f); - monitor_attributes = Fcar (call1 (Qdisplay_monitor_attributes_list, frame)); + monitor_attributes = call1 (Qframe_monitor_attributes, frame); if (NILP (monitor_attributes)) { /* No monitor attributes available. */ @@ -5890,7 +5890,7 @@ syms_of_frame (void) DEFSYM (Qframep, "framep"); DEFSYM (Qframe_live_p, "frame-live-p"); DEFSYM (Qframe_windows_min_size, "frame-windows-min-size"); - DEFSYM (Qdisplay_monitor_attributes_list, "display-monitor-attributes-list"); + DEFSYM (Qframe_monitor_attributes, "frame-monitor-attributes"); DEFSYM (Qwindow__pixel_to_total, "window--pixel-to-total"); DEFSYM (Qexplicit_name, "explicit-name"); DEFSYM (Qheight, "height"); -- 2.15.1 --=-=-=--