From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#23568: 25.0.94; Mode line menus appear incorrectly in some monitor configurations Date: Fri, 02 Jun 2017 01:18:46 -0600 Message-ID: <8737bi97s9.fsf@gmail.com> References: <871t50xvm6.fsf@gmail.com> <87y3thjw4i.fsf@gmail.com> <87vaoh1os3.fsf@gmail.com> <592E8C4A.7000104@gmx.at> <87vaoglo72.fsf@gmail.com> <592FA8A5.8060100@gmx.at> <874lvzzbwf.fsf@gmail.com> <87zidrxwhn.fsf@gmail.com> <5931014B.20700@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1496388013 19563 195.159.176.226 (2 Jun 2017 07:20:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Jun 2017 07:20:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 23568@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 02 09:20:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGgsT-0004lR-46 for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Jun 2017 09:20:09 +0200 Original-Received: from localhost ([::1]:48202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGgsW-0005h4-VV for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Jun 2017 03:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGgsR-0005fc-CQ for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 03:20:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGgsM-0001Ps-E0 for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 03:20:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGgsM-0001PW-B4 for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 03:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dGgsL-0002c4-VS for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 03:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Jun 2017 07:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23568 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23568-submit@debbugs.gnu.org id=B23568.14963879469970 (code B ref 23568); Fri, 02 Jun 2017 07:20:01 +0000 Original-Received: (at 23568) by debbugs.gnu.org; 2 Jun 2017 07:19:06 +0000 Original-Received: from localhost ([127.0.0.1]:50374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGgrS-0002ak-Ga for submit@debbugs.gnu.org; Fri, 02 Jun 2017 03:19:06 -0400 Original-Received: from mail-it0-f67.google.com ([209.85.214.67]:34056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGgrQ-0002aE-SI for 23568@debbugs.gnu.org; Fri, 02 Jun 2017 03:19:05 -0400 Original-Received: by mail-it0-f67.google.com with SMTP id d68so8722262ita.1 for <23568@debbugs.gnu.org>; Fri, 02 Jun 2017 00:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=iswN+DFZBRfLBVvFI8+5mT+LZsGeefIQHVrET0SveJM=; b=JvsNeSman94CHh3izEGash8hu16dCNhFxZKLMeGPmWk6jQYLmEeNOorfcum4c7pyIR q7BjAQxRRM47MHD5Ip3m/Lpw4xTSqLvq77cc6lk9SGoK/u22r1wC0T14xKP8xmIjp2sI 9+m4O+u/9G+Ot4aSTskAAXRHJTdOQpUVFX76IOQRymfKU/3fMoytZFoFg85zd0YUo7+Q eAQSCR0GL2SEkcOajbGPnb9rQU4T2IyM99tVDEaHP7YXjTYfWnfrDnNRiCfIZIiMYc+l Z844krshzsfwDWug2FdzxBdaGP+bd/QtTrFkLIPNVrtEUVwIvHpMAFj6+cuemoCr9qEY Mu2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=iswN+DFZBRfLBVvFI8+5mT+LZsGeefIQHVrET0SveJM=; b=berXfkcnnmAnkWmCX9MSasXKj4nG4sTEbQFXsZ07nX++9E2DLCZu2+SvHqaCIwah32 ZLMv6T/62V2HpdQCjNwdUN2+iMAhdka2L5stNLEbWqsYQPI7+s4ZJB4+NTM+PAI8XkCb qTW3UbwWWBxhkBEf87Gn9VnXRhrjjnIfnkc4XDkr03iihqrZYxjGmiKYplkbD6J1aril kCNG5OXnS/h++fBxChgnRcl2nhXYGpskoNbkVN2oeInx2v8NK1jgb/rIZGHt5lFDEqN0 NKVS4z77gnt/Aj4PH34DE6k5NuVgHKG7fLZdEbP2YqumZyKmVK5DpTkMy+7QGlvkJiTL BT8g== X-Gm-Message-State: AODbwcA5eJLpMPOqgzcg4g3D1Xg0aN33SdC7qyL5MUZIfwOi58nX0La1 Z3uDM99uOpKO+GCb X-Received: by 10.107.176.131 with SMTP id z125mr5084551ioe.161.1496387939011; Fri, 02 Jun 2017 00:18:59 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id u200sm729161itb.29.2017.06.02.00.18.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Jun 2017 00:18:58 -0700 (PDT) In-Reply-To: <5931014B.20700@gmx.at> (martin rudalics's message of "Fri, 02 Jun 2017 08:10:19 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133158 Archived-At: martin rudalics 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 > =E2=80=98display-monitor-attributes-list=E2=80=99 where only the dominati= ng 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} =3D 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 =3D (alist-get 'geometry monitor) for min-x =3D (pop geometry) for min-y =3D (pop geometry) for max-x =3D (+ min-x (pop geometry)) for max-y =3D (+ min-y (car geometry)) when (and (<=3D min-x x) (< x max-x) (<=3D min-y y) (< y max-y)) return (alist-get attribute monitor)) (alist-get attribute (frame-monitor-attributes frame))))