From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: menu-bar: disable items when no frame visible Date: Tue, 06 Dec 2005 02:54:54 +0200 Organization: JURTA Message-ID: <87psobhwo5.fsf@jurta.org> References: <708F3D2D-A87C-4F80-BC27-171D82653F4D@gmail.com> <069BF3EB-C5E4-4042-91E9-0DFB37C58E99@gmail.com> <36F6CF11-E742-4175-A995-E5A62EC2A335@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133832849 29200 80.91.229.2 (6 Dec 2005 01:34:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2005 01:34:09 +0000 (UTC) Cc: david.reitter@gmail.com, eliz@gnu.org, emacs-devel@gnu.org, jasonr@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 06 02:34:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EjRhK-0001VA-Kl for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2005 02:32:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EjRhU-0005ON-Gz for ged-emacs-devel@m.gmane.org; Mon, 05 Dec 2005 20:33:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EjRhB-0005Kf-OB for emacs-devel@gnu.org; Mon, 05 Dec 2005 20:32:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EjRh7-0005J8-RL for emacs-devel@gnu.org; Mon, 05 Dec 2005 20:32:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EjRh7-0005J3-Nu for emacs-devel@gnu.org; Mon, 05 Dec 2005 20:32:37 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EjRhc-0005d0-MU; Mon, 05 Dec 2005 20:33:08 -0500 Original-Received: from mail.neti.ee (80-235-34-231-dsl.mus.estpak.ee [80.235.34.231]) by Relayhost1.neti.ee (Postfix) with ESMTP id 3407216B3; Tue, 6 Dec 2005 03:32:35 +0200 (EET) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Tue, 29 Nov 2005 16:48:19 -0500") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:47026 Archived-At: > GTK menus can be detached from their frame. I am not absolutely sure > (and not able to test right now) what happens if you minimize their > frame (or otherwise make it invisible) though. > > Can someone tell us what the detached GTK menu bar does > when there is no visible frame? Which frame does it operate on? It operates on the frame from which it was detached. This frame remains invisible after selecting a menu item from the visible menu. > Is the suggestion (or menu-updating-frame (selected-frame)) correct > for the GTK case? At least, it doesn't make things worse. I discovered that currently even GTK builds have the same bug as on non-toolkit builds. For example, after evaluating on a GTK build: (define-key global-map [down-mouse-3] menu-bar-file-menu) the menu item "Save As..." is disabled in the popup menu called via [mouse-3]. After looking at the code I suspect that the same bug exists on W32 and OSX. In w32menu.c and macmenu.c `x-popup-menu' after setting Vmenu_updating_frame to the frame `f', resets it immediately to nil, so Vmenu_updating_frame eventually is always nil in popup menus. And xmenu.c doesn't set Vmenu_updating_frame at all in `x-popup-menu'. I guess the correct code for all three platforms should be: if (! NILP (position)) { ... XSETFRAME (Vmenu_updating_frame, f); } else Vmenu_updating_frame = Qnil; Is it right? -- Juri Linkov http://www.jurta.org/emacs/