unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
@ 2021-02-09 17:46 Andrii Kolomoiets
  2021-02-11  9:10 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Andrii Kolomoiets @ 2021-02-09 17:46 UTC (permalink / raw)
  To: 46406

[-- 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
  2021-02-09 17:46 Andrii Kolomoiets
@ 2021-02-11  9:10 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-11  9:10 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 46406

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

> Attached patch make the frame position and size ratios calculations
> related to the monitor on which the frame is.

Makes sense to me, I think?  So I've now applied this to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
       [not found] <m1v9arf7nl.fsf@christiantietze.de>
@ 2021-02-17 10:27 ` Andrii Kolomoiets
  2021-02-19 10:07   ` Andrii Kolomoiets
  0 siblings, 1 reply; 9+ messages in thread
From: Andrii Kolomoiets @ 2021-02-17 10:27 UTC (permalink / raw)
  To: Christian Tietze; +Cc: 46406

Christian Tietze <me@christiantietze.de> writes:

> Hi Andrii,

Hi Christian

> Your Emacs patch for (non)retina screens and frame sizes introduced a
> very weird bug where on the non-retina screen, the contents of the
> frame are drawn in 1/4th the available drawing space. It looks fine on
> the retina screen, though.
>
> See screenshots:
> https://github.com/daviderestivo/homebrew-emacs-head/issues/92
>
> I cannot offer a fix suggestion for this, because I don't know the
> emacs source well. Maybe you know something from the top of your head?

I'll take a look.

P.S. Please keep the bug email in CC on reply.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
  2021-02-17 10:27 ` bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float Andrii Kolomoiets
@ 2021-02-19 10:07   ` Andrii Kolomoiets
  2021-02-19 13:04     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Andrii Kolomoiets @ 2021-02-19 10:07 UTC (permalink / raw)
  To: Christian Tietze; +Cc: 46406

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

> Christian Tietze <me@christiantietze.de> writes:
>
>> Hi Andrii,
>
> Hi Christian
>
>> Your Emacs patch for (non)retina screens and frame sizes introduced a
>> very weird bug where on the non-retina screen, the contents of the
>> frame are drawn in 1/4th the available drawing space. It looks fine on
>> the retina screen, though.
>>
>> See screenshots:
>> https://github.com/daviderestivo/homebrew-emacs-head/issues/92
>>
>> I cannot offer a fix suggestion for this, because I don't know the
>> emacs source well. Maybe you know something from the top of your head?
>
> I'll take a look.

With the commit 0e2b123a4ef600f5b337972a7bb61c1fc4b7d0cd I have no
issue moving frame to the non-retina screen.  The issue appears for me
with the commit 68bd6f3ea9c05637501139c46f1f4304482db95f.

I suspect your issue were introduced in Bug#46155





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
  2021-02-19 10:07   ` Andrii Kolomoiets
@ 2021-02-19 13:04     ` Lars Ingebrigtsen
  2021-02-19 19:38       ` Alan Third
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-19 13:04 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: Alan Third, 46406, Christian Tietze

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

> With the commit 0e2b123a4ef600f5b337972a7bb61c1fc4b7d0cd I have no
> issue moving frame to the non-retina screen.  The issue appears for me
> with the commit 68bd6f3ea9c05637501139c46f1f4304482db95f.
>
> I suspect your issue were introduced in Bug#46155

OK; adding Alan to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
  2021-02-19 13:04     ` Lars Ingebrigtsen
@ 2021-02-19 19:38       ` Alan Third
  2021-02-20 13:00         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Third @ 2021-02-19 19:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 46406, Christian Tietze, Andrii Kolomoiets

On Fri, Feb 19, 2021 at 02:04:24PM +0100, Lars Ingebrigtsen wrote:
> Andrii Kolomoiets <andreyk.mad@gmail.com> writes:
> 
> > With the commit 0e2b123a4ef600f5b337972a7bb61c1fc4b7d0cd I have no
> > issue moving frame to the non-retina screen.  The issue appears for me
> > with the commit 68bd6f3ea9c05637501139c46f1f4304482db95f.
> >
> > I suspect your issue were introduced in Bug#46155
> 
> OK; adding Alan to the CCs.

Fix pushed as 283f98353fe3549ac8f66a3ab8fba85d93c81a88.

-- 
Alan Third





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
  2021-02-19 19:38       ` Alan Third
@ 2021-02-20 13:00         ` Lars Ingebrigtsen
  2021-02-22 22:08           ` Christian Tietze
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-20 13:00 UTC (permalink / raw)
  To: Alan Third; +Cc: 46406, Christian Tietze, Andrii Kolomoiets

Alan Third <alan@idiocy.org> writes:

>> OK; adding Alan to the CCs.
>
> Fix pushed as 283f98353fe3549ac8f66a3ab8fba85d93c81a88.

Thanks.  Christian, would it be possible for you to update Emacs 28 and
confirm that this fixes the problem you were seeing?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
  2021-02-20 13:00         ` Lars Ingebrigtsen
@ 2021-02-22 22:08           ` Christian Tietze
  2021-02-22 22:11             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Tietze @ 2021-02-22 22:08 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Alan Third, 46406, Andrii Kolomoiets

> On 20. Feb 2021, at 14:00, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> Thanks.  Christian, would it be possible for you to update Emacs 28 and
> confirm that this fixes the problem you were seeing?

Compiled from source and it looks good on both displays! 

Thanks for the quick responses, folks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float
  2021-02-22 22:08           ` Christian Tietze
@ 2021-02-22 22:11             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-22 22:11 UTC (permalink / raw)
  To: Christian Tietze; +Cc: Alan Third, 46406, Andrii Kolomoiets

Christian Tietze <me@christiantietze.de> writes:

>> On 20. Feb 2021, at 14:00, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>> 
>> Thanks.  Christian, would it be possible for you to update Emacs 28 and
>> confirm that this fixes the problem you were seeing?
>
> Compiled from source and it looks good on both displays! 

Thanks for checking; closing this bug report, then.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-22 22:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m1v9arf7nl.fsf@christiantietze.de>
2021-02-17 10:27 ` bug#46406: 28.0.50; [PATCH] Use frame monitor in frame_float 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
2021-02-09 17:46 Andrii Kolomoiets
2021-02-11  9:10 ` Lars Ingebrigtsen

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).