From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27647: 26.0.50; Line numbers implemented natively disappear momentarily when frame out of focus Date: Thu, 09 Nov 2017 18:12:02 +0200 Message-ID: <83r2t7qvn1.fsf@gnu.org> References: <83eftnitpj.fsf@gnu.org> <87inekjzy8.fsf@gmail.com> <87efp8jznq.fsf@gmail.com> <87shdo4150.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1510244001 24365 195.159.176.226 (9 Nov 2017 16:13:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Nov 2017 16:13:21 +0000 (UTC) Cc: 27647@debbugs.gnu.org, agrambot@gmail.com, kaushal.modi@gmail.com To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 09 17:13:13 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 1eCpS4-0005yq-OS for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Nov 2017 17:13:12 +0100 Original-Received: from localhost ([::1]:37647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCpSC-00064l-4Q for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Nov 2017 11:13:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCpRx-0005oB-Lz for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 11:13:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCpRu-00077p-DU for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 11:13:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eCpRu-00077e-A9 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 11:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eCpRu-0006Kr-1Q for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 11:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Nov 2017 16:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27647 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 27647-submit@debbugs.gnu.org id=B27647.151024392424289 (code B ref 27647); Thu, 09 Nov 2017 16:13:01 +0000 Original-Received: (at 27647) by debbugs.gnu.org; 9 Nov 2017 16:12:04 +0000 Original-Received: from localhost ([127.0.0.1]:60598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCpQy-0006Jg-IJ for submit@debbugs.gnu.org; Thu, 09 Nov 2017 11:12:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCpQx-0006JD-EZ for 27647@debbugs.gnu.org; Thu, 09 Nov 2017 11:12:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCpQm-0006Qq-FO for 27647@debbugs.gnu.org; Thu, 09 Nov 2017 11:11:58 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCpQi-0006PL-LZ; Thu, 09 Nov 2017 11:11:48 -0500 Original-Received: from [176.228.60.248] (port=2939 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eCpQi-0004vy-2S; Thu, 09 Nov 2017 11:11:48 -0500 In-reply-to: <87shdo4150.fsf@users.sourceforge.net> (message from Noam Postavsky on Wed, 08 Nov 2017 21:49:31 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:139668 Archived-At: > From: Noam Postavsky > Cc: Eli Zaretskii , 27647@debbugs.gnu.org, Kaushal Modi > Date: Wed, 08 Nov 2017 21:49:31 -0500 > > Aha, the problem is this condition in should_produce_line_number: > > static bool > should_produce_line_number (struct it *it) > { > ... > /* Don't display line number in tooltip frames. */ > if (FRAMEP (tip_frame) && EQ (WINDOW_FRAME (it->w), tip_frame)) > return false; > > Which sounds like it would be correct, except that the meaning of > tip_frame is different for GTK tooltips, as explained in x_hide_tip: > > static Lisp_Object > x_hide_tip (bool delete) > { > ... > #ifdef USE_GTK > { > /* When using system tooltip, tip_frame is the Emacs frame on > which the tip is shown. */ > struct frame *f = XFRAME (tip_frame); Thanks for the diagnose. I hate these tricks. > Leading to the following patch: Thanks, but this patch won't compile in any non-X build (because x_gtk_use_system_tooltips is only defined in xfns.c). Also, x_gtk_use_system_tooltips is non-zero by default in all X builds, even those without GTK, so I guess under this patch non-GTK builds will show line numbers in tooltip frames, is that right? I propose a slightly different patch below; could you try it? diff --git a/src/dispextern.h b/src/dispextern.h index 2f55d8c..430afbf 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3452,7 +3452,14 @@ void gamma_correct (struct frame *, COLORREF *); void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); void x_change_tool_bar_height (struct frame *f, int); +/* The frame used to display a tooltip. + + Note: In a GTK build with non-zero x_gtk_use_system_tooltips, this + variable holds the frame that shows the tooltip, not the frame of + the tooltip itself, so checking whether a frame is a tooltip frame + cannot just compare the frame to what this variable holds. */ extern Lisp_Object tip_frame; + extern Window tip_window; extern frame_parm_handler x_frame_parm_handlers[]; diff --git a/src/xdisp.c b/src/xdisp.c index 69b74dc..d4a0261 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21126,7 +21126,13 @@ should_produce_line_number (struct it *it) #ifdef HAVE_WINDOW_SYSTEM /* Don't display line number in tooltip frames. */ - if (FRAMEP (tip_frame) && EQ (WINDOW_FRAME (it->w), tip_frame)) + if (FRAMEP (tip_frame) && EQ (WINDOW_FRAME (it->w), tip_frame) +#ifdef USE_GTK + /* GTK builds store in tip_frame the frame that shows the tip, + so we need an additional test. */ + && !NILP (Fframe_parameter (tip_frame, Qtooltip)) +#endif + ) return false; #endif