unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andrea Vettorello" <andrea.vettorello@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: removing menubar and window frame
Date: Tue, 2 Dec 2008 13:05:50 +0100	[thread overview]
Message-ID: <7d5440240812020405t1cf94c04v154eecd2876fa879@mail.gmail.com> (raw)
In-Reply-To: <20081202110513.GA29741@lars-x200s>

On Tue, Dec 2, 2008 at 12:05 PM, Chengqi(Lars) Song <songcq@gmail.com> 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




  parent reply	other threads:[~2008-12-02 12:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02  4:33 removing menubar and window frame Chengqi(Lars) Song
2008-12-02 10:03 ` Peter Dyballa
2008-12-02 11:05   ` Chengqi(Lars) Song
2008-12-02 11:47     ` Peter Dyballa
2008-12-02 12:05     ` Andrea Vettorello [this message]
     [not found]   ` <mailman.1686.1228215916.26697.help-gnu-emacs@gnu.org>
2008-12-02 12:39     ` Andreas Politz
     [not found] ` <mailman.1685.1228212233.26697.help-gnu-emacs@gnu.org>
2008-12-02 12:59   ` Stefan Kamphausen
2008-12-02 13:19 ` tyler
     [not found] <mailman.1663.1228192384.26697.help-gnu-emacs@gnu.org>
2008-12-02 14:42 ` htbest2000

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d5440240812020405t1cf94c04v154eecd2876fa879@mail.gmail.com \
    --to=andrea.vettorello@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).