From: Andrii Kolomoiets <andreyk.mad@gmail.com>
To: 46406@debbugs.gnu.org
Subject: bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
Date: Tue, 09 Feb 2021 19:46:53 +0200 [thread overview]
Message-ID: <m2wnvhcewi.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-frame-monitor-in-frame_float.patch --]
[-- Type: text/x-patch, Size: 1436 bytes --]
From 28192ba6ea2769c11bfce1dc4b184a15e8c09248 Mon Sep 17 00:00:00 2001
From: Andrii Kolomoiets <andreyk.mad@gmail.com>
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
next reply other threads:[~2021-02-09 17:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 17:46 Andrii Kolomoiets [this message]
2021-02-11 9:10 ` bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float Lars Ingebrigtsen
[not found] <m1v9arf7nl.fsf@christiantietze.de>
2021-02-17 10:27 ` Andrii Kolomoiets
2021-02-19 10:07 ` Andrii Kolomoiets
2021-02-19 13:04 ` Lars Ingebrigtsen
2021-02-19 19:38 ` Alan Third
2021-02-20 13:00 ` Lars Ingebrigtsen
2021-02-22 22:08 ` Christian Tietze
2021-02-22 22:11 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2wnvhcewi.fsf@gmail.com \
--to=andreyk.mad@gmail.com \
--cc=46406@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).