Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

removing menubar and window frame

6 views
Skip to first unread message

Chengqi(Lars) Song

unread,
Dec 1, 2008, 11:33:03 PM12/1/08
to help-gnu-emacs
Hello,

To maximize the space for editing area, I want to hide manubar and the
window-frame, but sometimes I need them so I also want to assign a
hotkey to toggle them. Could you give any suggestion? Thank you.

By the way, by "window-frame", I mean the outer frame of the window with
the window title, maximze/minimize/close buttons.

thanks
lars


Peter Dyballa

unread,
Dec 2, 2008, 5:03:35 AM12/2/08
to Chengqi Song, help-gnu-emacs


To me it's still not clear what you mean with "window-frame" – is it
the "X window decoration" applied by an "X window manager" to the GNU
Emacs X client frame (that can house a few "windows")? Or do you mean
the fringe area(s)?

Maybe it's worth, for you, to check the entries in Options menu ->
Show/Hide. By experimenting you might get exactly what you want.

--
Greetings

Pete

Claiming that the Macintosh is inferior to Windows because most
people use Windows, is like saying that all other restaurants serve
food that is inferior to McDonald's.


Chengqi(Lars) Song

unread,
Dec 2, 2008, 6:05:13 AM12/2/08
to help-gnu-emacs
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?

Thanks
Lars

On Tue, 02 Dec 2008, Peter Dyballa wrote:

>
> Am 02.12.2008 um 05:33 schrieb Chengqi(Lars) Song:
>

> To me it's still not clear what you mean with "window-frame" ? is it the

Peter Dyballa

unread,
Dec 2, 2008, 6:47:27 AM12/2/08
to Chengqi Song, help-gnu-emacs

Am 02.12.2008 um 12:05 schrieb Chengqi(Lars) Song:

> Is there any method to toggle menubar and the "x window
> decroration" by
> a hotkey?

I believe in software: there surely is one! Just write it, make it
simply exchange Metacity with twm or evilwm or another minimalist
window manager (I remember having visited an internet site with lots
of screenshots showing decoration by a large number of window
managers, but can't find it), bind this function to a key as that for
switching on and off the menu-bar or put it also into Options -> Show/
Hide menu.


I remember having killed the original window manager a few times.
While the X server continued running the X clients also kept running,
allowing me to launch another window manager.

--
Greetings

Pete

Who the fsck is "General Failure," and why is he reading my disk?


Andrea Vettorello

unread,
Dec 2, 2008, 7:05:50 AM12/2/08
to help-gnu-emacs
On Tue, Dec 2, 2008 at 12:05 PM, Chengqi(Lars) Song <son...@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


Andreas Politz

unread,
Dec 2, 2008, 7:39:58 AM12/2/08
to
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?
>

For the first part bind `menu-bar-mode' to some key, for the second it only
depends on you window-manager.

-ap

Stefan Kamphausen

unread,
Dec 2, 2008, 7:59:06 AM12/2/08
to
Hi,

Peter Dyballa <Peter_...@Web.DE> writes:

> Am 02.12.2008 um 05:33 schrieb Chengqi(Lars) Song:
>
>> To maximize the space for editing area, I want to hide manubar and the
>> window-frame, but sometimes I need them so I also want to assign a
>> hotkey to toggle them. Could you give any suggestion? Thank you.
>>

a good while back a friend of mine an I wrote active-menu.el for XEmacs
which showed the menu-bar as soon as your mouse comes close to where
the menu-bar usually would be and removes it if your mouse is far away.
I used that for years.

After switching to Gnu Emacs I tried to port it and it kinda works but I
don't use it anymore so there are probably some glitches in it.

Besides, the porting was really a pain since the mouse-position commands
are subtly different across Gnu Emacs and XEmacs (see the comments for
more ranting). In the end I got so frustrated working on this that I
quit. If someone with a deeper understanding of things wants to take
over or patch... your welcome.

If you're still interested after reading all this:
http://www.skamphausen.de/cgi-bin/ska/active-menu.el

>> By the way, by "window-frame", I mean the outer frame of the window
>> with
>> the window title, maximze/minimize/close buttons.

active-menu does nothing to the frame.

Cheers,
Stefan
--
Stefan Kamphausen --- http://www.skamphausen.de
a blessed +42 regexp of confusion (weapon in hand)
You hit. The format string crumbles and turns to dust.

tyler

unread,
Dec 2, 2008, 8:19:37 AM12/2/08
to help-gn...@gnu.org
"Chengqi(Lars) Song" <son...@gmail.com> writes:

> To maximize the space for editing area, I want to hide manubar and the
> window-frame, but sometimes I need them so I also want to assign a
> hotkey to toggle them. Could you give any suggestion? Thank you.

My .emacs includes

(menu-bar-mode -1)

which leaves the menu-bar hidden by default. Rather than have it pop up
again when I want to see it, I use 'M-`' (i.e., meta and backtick
pressed together). This provides a quick and temporary text-version of
the menu-bar which has the benefit of not requiring a mouse to use.

> By the way, by "window-frame", I mean the outer frame of the window with
> the window title, maximze/minimize/close buttons.

This is beyond the realm of emacs I think, and requires a suitable
window manager. I use fluxbox, which provides a mechanism for toggling
the window decorations through the config files. I have the following in
my ~/.fluxbox/keys file:

Mod4 d :ToggleDecor

The result is that pressing Super-d toggles the max/min/close and title
bar on and off. Maybe Gnome and KDE have similar options, I don't know.

Cheers,

Tyler

--
There is something fascinating about science. One gets such wholesale
returns of conjecture out of such a trifling investment of fact.
--Mark Twain

htbest2000

unread,
Dec 2, 2008, 9:42:53 AM12/2/08
to
for the part `window-frame', you would get the answers:
http://www.emacswiki.org/emacs/FullScreen
0 new messages