emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: menu-updating-frame is nil on X


From: Juri Linkov
Subject: Re: menu-updating-frame is nil on X
Date: Tue, 08 Nov 2005 14:43:43 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>> In Emacs configured with '--with-x-toolkit=no' on i686-pc-linux-gnu
>> and run with `emacs -Q', `menu-updating-frame' is nil.  This causes
>> some menu items to be permanently disabled due to the condition in
>> `menu-bar-menu-frame-live-and-visible-p' where `(display-multi-frame-p)'
>> returns `t'.
>
> The theory behind that code was that menu-updating-frame cannot
> possibly be nil on a display that supports multiple frames visible at
> the same time.  How come the non-toolkit version doesn't bind
> menu-updating-frame to something non-nil?  Can you please investigate?

Emacs built without a X toolkit doesn't have a separate frame for
the menu bar.

What do you think about the following change?  Would it work in all cases?

Index: lisp/menu-bar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/menu-bar.el,v
retrieving revision 1.278
diff -c -r1.278 menu-bar.el
*** lisp/menu-bar.el    1 Nov 2005 23:21:39 -0000       1.278
--- lisp/menu-bar.el    8 Nov 2005 12:43:03 -0000
***************
*** 1424,1431 ****
  (defun menu-bar-menu-frame-live-and-visible-p ()
    "Return non-nil if the menu frame is alive and visible.
  The menu frame is the frame for which we are updating the menu."
!   (let ((menu-frame (if (display-multi-frame-p) menu-updating-frame
!                     (selected-frame))))
      (and (frame-live-p menu-frame)
         (frame-visible-p menu-frame))))
  
--- 1424,1430 ----
  (defun menu-bar-menu-frame-live-and-visible-p ()
    "Return non-nil if the menu frame is alive and visible.
  The menu frame is the frame for which we are updating the menu."
!   (let ((menu-frame (or menu-updating-frame (selected-frame))))
      (and (frame-live-p menu-frame)
         (frame-visible-p menu-frame))))

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]