From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Andrea Vettorello" Newsgroups: gmane.emacs.help Subject: Re: removing menubar and window frame Date: Tue, 2 Dec 2008 13:05:50 +0100 Message-ID: <7d5440240812020405t1cf94c04v154eecd2876fa879@mail.gmail.com> References: <20081202043303.GA13422@lars-x200s> <20081202110513.GA29741@lars-x200s> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1228219732 27364 80.91.229.12 (2 Dec 2008 12:08:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Dec 2008 12:08:52 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 02 13:09:57 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L7U4i-0006Xk-UE for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Dec 2008 13:09:57 +0100 Original-Received: from localhost ([127.0.0.1]:52557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7U3Y-0006OY-Ml for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Dec 2008 07:08:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7U3A-0006Nf-00 for help-gnu-emacs@gnu.org; Tue, 02 Dec 2008 07:08:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7U37-0006Mt-09 for help-gnu-emacs@gnu.org; Tue, 02 Dec 2008 07:08:17 -0500 Original-Received: from [199.232.76.173] (port=39012 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7U36-0006Mh-0x for help-gnu-emacs@gnu.org; Tue, 02 Dec 2008 07:08:16 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.152]:51486) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7U0p-0006Bw-55 for help-gnu-emacs@gnu.org; Tue, 02 Dec 2008 07:05:55 -0500 Original-Received: by fg-out-1718.google.com with SMTP id l26so2287455fgb.30 for ; Tue, 02 Dec 2008 04:05:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=/ZW1BPhFKA9QahmAOnQsFmxp4+/E5o+VOddQPlkFCEs=; b=tEStpcqqfCwBucDfBq5NANUhC2K2YNKHYHDwEiVtu65mfthNTudWc0CaBU2sRakqdJ wulsmjJjO4Z0fzQ/Ui0MC9h+s7OTQAQhAOD1KV6raiRu2nUJo/7YkNan88hUvi4bkS+c gNyOGRm7MEAk4Vh8E+uN45iznVD1RPg+b847Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=AWsP8St50d6/Qt8M3mlq4l2Gj3s1IW4v3vziJ56X6yw+2EXBzkj4ynQQJZ7QJXjOSH +jC9h/sex2E5TyAegkRdzxgMvT3R3KbZDMjhPtREIZRPetU0WNGU9YpbAg6oGRISQTo+ m1zfNrZM6+nYcZBlvDsL6HFK22Nz4XZfbHQrY= Original-Received: by 10.181.138.13 with SMTP id q13mr4233291bkn.95.1228219550416; Tue, 02 Dec 2008 04:05:50 -0800 (PST) Original-Received: by 10.180.220.6 with HTTP; Tue, 2 Dec 2008 04:05:50 -0800 (PST) In-Reply-To: <20081202110513.GA29741@lars-x200s> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60306 Archived-At: On Tue, Dec 2, 2008 at 12:05 PM, Chengqi(Lars) Song wrote: > Hi, > > Thanks for you comments. By "window-frame" I mean the "X Window > decroration" applied by Gnome's metacity window manager. > Is there any method to toggle menubar and the "x window decroration" by > a hotkey? I put the following together some time ago: (defun toggle-frame-fullscreen () "Toggle current frame fullscreen" (interactive) (if (eq (frame-parameter nil 'fullscreen) 'fullboth) (fullscreen-disable) (fullscreen-enable))) (defun fullscreen-enable () (menu-bar-mode -1) (set-frame-parameter nil 'fullscreen 'fullboth)) (defun fullscreen-disable () (set-frame-parameter nil 'fullscreen nil) (sleep-for 0.0001) (menu-bar-mode 1)) It doesn't work very well, sometimes the frame is not resized back correctly, I suspect a race condition somewhere when the menu bar is removed/added and the fullscreen variable is set, but I didn't delved too deep in the code, I put a (somewhat hackish) small delay that makes it work most of the times... -- Andrea