From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#22549: 25.0.50; Tooltips placed outside of screen limits Date: Sat, 06 Feb 2016 10:30:38 +0100 Message-ID: <56B5BD3E.1000305@gmx.at> References: <87zivh2k98.fsf@telefonica.net> <56B3747B.1000303@gmx.at> <87r3gs30rk.fsf@wanadoo.es> <56B384F4.8040208@gmx.at> <87d1sc2smy.fsf@wanadoo.es> <56B4DF82.8040106@gmx.at> <87d1sa23cj.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1454752192 22843 80.91.229.3 (6 Feb 2016 09:49:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2016 09:49:52 +0000 (UTC) Cc: 22549@debbugs.gnu.org To: =?UTF-8?Q?=C3=93scar?= Fuentes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 06 10:49:43 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aRzUs-0004fi-TH for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Feb 2016 10:49:43 +0100 Original-Received: from localhost ([::1]:52753 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRzUs-00061p-Ev for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Feb 2016 04:49:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRzCr-0004cN-DO for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 04:31:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRzCo-0001kP-6W for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 04:31:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRzCo-0001kL-3f for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 04:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aRzCn-0002JL-Ud for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 04:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Feb 2016 09:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22549-submit@debbugs.gnu.org id=B22549.14547510608869 (code B ref 22549); Sat, 06 Feb 2016 09:31:01 +0000 Original-Received: (at 22549) by debbugs.gnu.org; 6 Feb 2016 09:31:00 +0000 Original-Received: from localhost ([127.0.0.1]:35129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRzCl-0002Iy-S1 for submit@debbugs.gnu.org; Sat, 06 Feb 2016 04:31:00 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:58153) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRzCk-0002Ig-0S for 22549@debbugs.gnu.org; Sat, 06 Feb 2016 04:30:58 -0500 Original-Received: from [192.168.1.101] ([212.95.7.47]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LuOYx-1a0en41Aut-011mx7; Sat, 06 Feb 2016 10:30:45 +0100 In-Reply-To: <87d1sa23cj.fsf@wanadoo.es> X-Provags-ID: V03:K0:aqj9x5n4x8j08bLAWqUok3H1LZe4hg5BF/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man-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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112557 Archived-At: > The first problem with the patch is that it crashes when there is not = an > Emacs frame on some of the monitors. This is solved changing the `if' > to: > > if (CONSP (frames) && !NILP (XCDR (frames)) > && EQ (frame, XCAR (XCDR (frames)))) Silly me. I was looking for Fcadr, didn't find it and just grabbed whatever there was without thinking of the consequences. Translating code back from Elisp to C is a PITA. And I don't want to tear apart =E2=80=98x-display-monitor-attributes-list=E2=80=99 for the pr= esent purpose, especially not on Emacs-25. Maybe I can convince Yamamoto Mitsuharu to provide a C-friendly interface for master. > The next problem is that the condition > > EQ (frame, XCAR (XCDR (frames))) > > is always false, which makes sense because `frame' is the tooltip fram= e > (unless I'm misunderstanding what XSETFRAME does) and it is not listed= > on `frames'. Another silliness. With GTK, FRAME is the original frame and I stepped through this with GDB on a GTK build only and it obviously worked. With Lucid, FRAME is the tooltip frame and I just looked at the results which were OK since I have only one monitor. > For going ahead I "corrected" this with > > struct frame *sf =3D XFRAME (selected_frame); > XSETFRAME (frame, sf); > > which is wrong when there is more than one frame, because the tooltip > may be shown for a frame that is not the selected one (showing tooltip= s > for other than the selected frame seems inappropriate to me, but that'= s > how Emacs behaves right now). Maybe someone will find a use case for it. Let's not bother now but simply agree that the selected frame might be on another monitor and so could be the wrong frame. > Then, as the comparision only takes into account the first frame liste= d > on `frames', even if `frame' where correct (the frame that triggered t= he > tooltip) it could fail when there is more than one Emacs frame on the > same monitor. I don't understand you here. There can be any number of frames on the "right" monitor. The important thing is to get the monitor of the frame where the tooltip shall be shown. > I observed that the tooltip is correctly placed when the right > conditions (see below) are satisfied. > > What is missing is to determine the parent frame of the tooltip frame,= =2E.. that's the one passed via FRAME to =E2=80=98x-show-tip=E2=80=99 and= we just have to pass it on to compute_tip_xy ... > instead of using just the selected one as I did, and to search for tha= t > frame on the list of frames associated to the current monitor, instead= > of just testing the first frame on the list. martin