help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: removing menubar and window frame


From: Andrea Vettorello
Subject: Re: removing menubar and window frame
Date: Tue, 2 Dec 2008 13:05:50 +0100

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




reply via email to

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