GNU bug report logs -
#23568
25.0.94; Mode line menus appear incorrectly in some monitor configurations
Previous Next
Reported by: Alex <agrambot <at> gmail.com>
Date: Wed, 18 May 2016 02:29:01 UTC
Severity: normal
Found in version 25.0.94
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 23568 <at> debbugs.gnu.org (full text, mbox):
martin rudalics <rudalics <at> gmx.at> writes:
>> I just noticed that frame.el also includes frame-monitor-attributes,
>> which also makes me think that frame.el is a nice place for these
>> procedures.
>
> For the moment putting them in frame.el should be OK. Eventually these
> functions should be in frame.c and represent stripped down versions of
> ‘display-monitor-attributes-list’ where only the dominating monitor for
> the given frame or coordinates is investigated. Other monitors and
> things like lists of frames dominated by a monitor, mm values, name and
> source would not be calculated by the respective backends. These values
> are not needed for checking tip frame or menu positions and repeatedly
> evaluating and returning the same values seems rather silly.
I agree that you shouldn't have to calculate everything each time,
though I don't know enough about the C code to achieve that right now.
In the end, we would still leave the function interface so that users
can still call the discussed procedures from lisp code, right? I don't
want to introduce an interface just for it to be removed later on if I
can avoid it.
In any case, I altered display-monitor-attribute to use
frame-monitor-attributes and to not succeed on {x, y} = max-{x, y}:
(defun display-monitor-attribute (attribute &optional frame x y)
"Return the value of the attribute of the 'current' monitor.
By default, use the frame info to determine the current monitor,
but if x and y are non-nil then use the given coordinates to
determine it."
(if (and x y)
(cl-loop for monitor in (display-monitor-attributes-list)
for geometry = (alist-get 'geometry monitor)
for min-x = (pop geometry)
for min-y = (pop geometry)
for max-x = (+ min-x (pop geometry))
for max-y = (+ min-y (car geometry))
when (and (<= min-x x)
(< x max-x)
(<= min-y y)
(< y max-y))
return (alist-get attribute monitor))
(alist-get attribute (frame-monitor-attributes frame))))
This bug report was last modified 7 years and 350 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.