From 54ee7410c5a6301f37cb107317a5533c0bcc3cf9 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 2 Jul 2010 12:35:08 -0400 Subject: [PATCH] Fix faulty `if' statement in delete_frame. * frame.c (Qtooltip): New var. (delete_frame): Use it. Fix faulty if statement. Don't update mode line for tooltip frames. Suggested by Martin Rudalics. * xfns.c (x_create_tip_frame): * w32fns.c (x_create_tip_frame): Use it. --- src/ChangeLog | 9 +++++++++ src/frame.c | 14 ++++++++++---- src/w32fns.c | 5 ++--- src/xfns.c | 7 ++++--- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0db4a543ab7..77581160a0e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2010-07-02 Chong Yidong + + * frame.c (Qtooltip): New var. + (delete_frame): Use it. Fix faulty if statement. Don't update + mode line for tooltip frames. Suggested by Martin Rudalics. + + * xfns.c (x_create_tip_frame): + * w32fns.c (x_create_tip_frame): Use it. + 2010-06-30 Naohiro Aota (tiny change) * xftfont.c (xftfont_open): Check font width one by one also when diff --git a/src/frame.c b/src/frame.c index 5915c00bca1..a30d1e18175 100644 --- a/src/frame.c +++ b/src/frame.c @@ -100,6 +100,7 @@ Lisp_Object Qgeometry; /* Not used */ Lisp_Object Qheight, Qwidth; Lisp_Object Qleft, Qright; Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name; +Lisp_Object Qtooltip; Lisp_Object Qinternal_border_width; Lisp_Object Qmouse_color; Lisp_Object Qminibuffer; @@ -1329,7 +1330,7 @@ delete_frame (frame, force) struct frame *sf = SELECTED_FRAME (); struct kboard *kb; - int minibuffer_selected; + int minibuffer_selected, tooltip_frame; if (EQ (frame, Qnil)) { @@ -1381,13 +1382,15 @@ delete_frame (frame, force) } } + tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip"))); + /* Run `delete-frame-functions' unless FORCE is `noelisp' or frame is a tooltip. FORCE is set to `noelisp' when handling a disconnect from the terminal, so we don't dare call Lisp code. */ - if (NILP (Vrun_hooks) || !NILP (Fframe_parameter (frame, intern ("tooltip")))) + if (NILP (Vrun_hooks) || tooltip_frame) ; - if (EQ (force, Qnoelisp)) + else if (EQ (force, Qnoelisp)) pending_funcalls = Fcons (list3 (Qrun_hook_with_args, Qdelete_frame_functions, frame), pending_funcalls); @@ -1633,7 +1636,8 @@ delete_frame (frame, force) } /* Cause frame titles to update--necessary if we now have just one frame. */ - update_mode_lines = 1; + if (!tooltip_frame) + update_mode_lines = 1; return Qnil; } @@ -4451,6 +4455,8 @@ syms_of_frame () staticpro (&Qicon_left); Qicon_top = intern_c_string ("icon-top"); staticpro (&Qicon_top); + Qtooltip = intern_c_string ("tooltip"); + staticpro (&Qtooltip); Qleft = intern_c_string ("left"); staticpro (&Qleft); Qright = intern_c_string ("right"); diff --git a/src/w32fns.c b/src/w32fns.c index bc310da0d2f..fe03537c49b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5584,9 +5584,8 @@ x_create_tip_frame (dpyinfo, parms, text) change_frame_size (f, height, width, 1, 0, 0); /* Add `tooltip' frame parameter's default value. */ - if (NILP (Fframe_parameter (frame, intern ("tooltip")))) - Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), - Qnil)); + if (NILP (Fframe_parameter (frame, Qtooltip))) + Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil)); /* Set up faces after all frame parameters are known. This call also merges in face attributes specified for new frames. diff --git a/src/xfns.c b/src/xfns.c index 6d041708eec..d06b83b5186 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -205,6 +205,8 @@ extern Lisp_Object Vwindow_system_version; /* The below are defined in frame.c. */ +extern Lisp_Object Qtooltip; + #if GLYPH_DEBUG int image_cache_refcount, dpyinfo_refcount; #endif @@ -4914,9 +4916,8 @@ x_create_tip_frame (dpyinfo, parms, text) change_frame_size (f, height, width, 1, 0, 0); /* Add `tooltip' frame parameter's default value. */ - if (NILP (Fframe_parameter (frame, intern ("tooltip")))) - Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), - Qnil)); + if (NILP (Fframe_parameter (frame, Qtooltip))) + Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil)); /* FIXME - can this be done in a similar way to normal frames? http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */ -- 2.39.2