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

Emacsw32 fullscreen

13 views
Skip to first unread message

Evans Winner

unread,
Mar 12, 2008, 3:50:20 PM3/12/08
to
Is there a way to send a keystroke to the underlying OS or window
manager from Emacs? I am trying to get a true fullscreen (no
titlebar) in Emacsw32. f11 seems to be getting trapped by Emacs (and
conkeror too, by the way).

(I am required to use MS Windows at work, so I am trying to figure out
how to get my user environment something like at home, with stumpwm,
conkeror and Emacs. So far I haven't found any Windows replacement
for stumpwm, but I am experimenting with bbLean....)

Any leads for this fullscreen problem would be much appreciated.

Eli Zaretskii

unread,
Mar 13, 2008, 12:14:04 AM3/13/08
to help-gn...@gnu.org
> From: Evans Winner <ego...@gmail.com>
> Date: Wed, 12 Mar 2008 12:50:20 -0700 (PDT)

>
> Is there a way to send a keystroke to the underlying OS or window
> manager from Emacs? I am trying to get a true fullscreen (no
> titlebar) in Emacsw32. f11 seems to be getting trapped by Emacs (and
> conkeror too, by the way).

"C-h f w32-send-sys-command" will tell you this:

w32-send-sys-command is a built-in function in `C source code'.
(w32-send-sys-command command &optional frame)

Send frame a Windows WM_SYSCOMMAND message of type command.
Some useful values for command are #xf030 to maximize frame (#xf020
to minimize), #xf120 to restore frame to original size, and #xf100
to activate the menubar for keyboard access. #xf140 activates the
screen saver if defined.

If optional parameter frame is not specified, use selected frame.

Is this what you are looking for?


Evans Winner

unread,
Mar 13, 2008, 5:57:45 PM3/13/08
to
Eli Zaretskii <el...@gnu.org> writes:

>> Is there a way to send a keystroke to the underlying
>> OS or window manager from Emacs? I am trying to get
>> a true fullscreen (no titlebar) in Emacsw32. f11
>> seems to be getting trapped by Emacs (and conkeror
>> too, by the way).

"C-h f w32-send-sys-command" will tell you this:

[...]



Is this what you are looking for?

Well, that does maximize the frame, but it does not remove
the title bar, as happens in Linux. Looking into this I am
finding that it looks like this is somewhat non-trivial.
There is something that is designed to do that in Windows
called emacs-darkroom-mode[1], but it has about a million
dependencies[2].

In general, though, it would be lovely to be able to make a
really distraction-free environment out of Emacs. The other
thing I would love is a feature such that the
minibuffer/modeline would vanish when not being used for
messages or output, leaving that space for text -- something
like the auto-hide feature that the task-bar has in some
window managers. And, as long as I'm fantasising, I'd like
the Swedish bikini team to parachute in with a six-pack of
beer....

Footnotes:
[1] http://www.martyn.se/code/emacs/darkroom-mode/

[2] Slight exaggeration.

Drew Adams

unread,
Mar 13, 2008, 7:31:15 PM3/13/08
to Evans Winner, help-gn...@gnu.org
> And, as long as I'm fantasising, I'd like
> the Swedish bikini team to parachute in with a six-pack of
> beer....

You'll have to wait for Emacs 23, I'm afraid. But there will be 8 beers to a
pack, since it uses UTF8.

Eli Zaretskii

unread,
Mar 14, 2008, 8:06:20 AM3/14/08
to help-gn...@gnu.org
> From: Evans Winner <tho...@timbral.net>
> Date: Thu, 13 Mar 2008 15:57:45 -0600

>
> Eli Zaretskii <el...@gnu.org> writes:
>
> >> Is there a way to send a keystroke to the underlying
> >> OS or window manager from Emacs? I am trying to get
> >> a true fullscreen (no titlebar) in Emacsw32. f11
> >> seems to be getting trapped by Emacs (and conkeror
> >> too, by the way).
>
> "C-h f w32-send-sys-command" will tell you this:
>
> [...]
>
> Is this what you are looking for?
>
> Well, that does maximize the frame, but it does not remove
> the title bar, as happens in Linux.

I understood that you want to remove the title bar, I just thought
that calling w32-send-sys-command with some value other than those
advertised in the doc string would accomplish what you want.


Lennart Borgman (gmail)

unread,
Mar 14, 2008, 8:38:55 AM3/14/08
to Eli Zaretskii, help-gn...@gnu.org
Eli Zaretskii wrote:
>> From: Evans Winner <tho...@timbral.net>
>> Date: Thu, 13 Mar 2008 15:57:45 -0600
>>
>> Eli Zaretskii <el...@gnu.org> writes:
>>
>> >> Is there a way to send a keystroke to the underlying
>> >> OS or window manager from Emacs? I am trying to get
>> >> a true fullscreen (no titlebar) in Emacsw32. f11
>> >> seems to be getting trapped by Emacs (and conkeror
>> >> too, by the way).
>>
>> "C-h f w32-send-sys-command" will tell you this:
>>
>> [...]
>>
>> Is this what you are looking for?
>>
>> Well, that does maximize the frame, but it does not remove
>> the title bar, as happens in Linux.
>
> I understood that you want to remove the title bar, I just thought
> that calling w32-send-sys-command with some value other than those
> advertised in the doc string would accomplish what you want.

I am not quite sure, but I do not think it could be done that way. There
are some SC_* keys you can send, like SC_MAXIMIZE. None of these seem to
remove the title bar.

It looks like some C-level code is needed, see

http://www.martyn.se/code/emacs/darkroom-mode/w32toggletitle.py

But why did not Martin record the names of the constant there ...?


Jason Rumney

unread,
Mar 14, 2008, 9:08:30 AM3/14/08
to
On 14 Mar, 12:06, Eli Zaretskii <e...@gnu.org> wrote:

> I understood that you want to remove the title bar, I just thought
> that calling w32-send-sys-command with some value other than those
> advertised in the doc string would accomplish what you want.

I'm not aware of any standard feature of Windows that removes the
title bar. The application would have to take care of this itself. The
OP was perhaps confused by the fact that in applications that support
a "full screen" mode, F11 is almost universally the key that toggles
it, so thought that if Emacs merely passed F11 to Windows it would
benefit from the behaviour, but that is not so. If it was the case,
then w32-send-sys-command would almost certainly work.

Sean Sieger

unread,
Mar 14, 2008, 2:53:58 PM3/14/08
to help-gn...@gnu.org
Jason Rumney <jason...@gmail.com> writes:

I'm not aware of any standard feature of Windows that removes the
title bar. The application would have to take care of this itself.

Forgive the persistence---so, when one does F11 on say Internet
Explorer, and most everything, including the title bar goes away, it's
not a system call that I could capitalize on that makes this happen?

Closely related to this question is, is there something that I could put
in my .emacs that would enable the title bar menu? I miss being able to
do `Alt-Space' on the only application---beside IE---that I use when I
boot up in Windows.

Jason Rumney

unread,
Mar 14, 2008, 6:42:11 PM3/14/08
to
On 14 Mar, 18:53, Sean Sieger <sean.sie...@gmail.com> wrote:

If you put the following in .emacs, you will be able to do Alt Space
(two separate key presses - not holding Alt down).

(setq w32-pass-alt-to-system t)

Even without that, you can use F10 Space (or F10 right down if you are
going to be using the arrow keys to navigate anyway).

Sean Sieger

unread,
Mar 14, 2008, 9:45:57 PM3/14/08
to help-gn...@gnu.org
Jason Rumney <jason...@gmail.com> writes:

Thank you for your patience, Jason.

If you put the following in .emacs, you will be able to do Alt Space
(two separate key presses - not holding Alt down).

(setq w32-pass-alt-to-system t)

And thank you for this.

phromo

unread,
Mar 19, 2008, 6:05:25 PM3/19/08
to
On 14 Mar, 13:38, "Lennart Borgman (gmail)"

<lennart.borg...@gmail.com> wrote:
>
> It looks like some C-level code is needed, see
>
> http://www.martyn.se/code/emacs/darkroom-mode/w32toggletitle.py
>
> But why did not Martin record the names of the constant there ...?

Sorry about that,
the int '-16' is for Style, (i.e, window style). The withTitle value
is the integer-version of 0x00C00000. This all resides in user32.dll.
Does that help? :)

As to constant names, I couldn't help you. I myself dug this up on an
AutoIT-forum somewhere.

... I'm thinking about just releasing a .net-compiled toggletitle.exe
to get rid of the python dependencies. But unfortunately time seems to
be running away from me all the time :)

// Martin

0 new messages