GNU bug report logs - #25408
Remove Decorations Around Emacs Frame (Windows OS)

Previous Next

Package: emacs;

Reported by: Arthur Miller <arthur.miller.no1 <at> gmail.com>

Date: Mon, 9 Jan 2017 22:21:02 UTC

Severity: wishlist

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Arthur Miller <arthur.miller.no1 <at> gmail.com>, 25408 <at> debbugs.gnu.org
Subject: bug#25408: Remove Decorations Around Emacs Frame (Windows OS)
Date: Tue, 10 Jan 2017 09:23:02 +0100
> I suggest either
> to implement this in a "border-width" property when border width
> is set to 0, or to implement a new variable/function that can be set in
> init file, such as for example "no-frame-borders t".

I'm using a frame parameter "undecorated" for this.  On Windows it is
handled by the following function in w32fns.c:

void
x_set_undecorated (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
  HWND hwnd = FRAME_W32_WINDOW (f);
  DWORD dwStyle = GetWindowLong (hwnd, GWL_STYLE);
  Lisp_Object border_width = Fcdr (Fassq (Qborder_width, f->param_alist));

  block_input ();
  if (!NILP (new_value) && !FRAME_UNDECORATED (f))
    {
      dwStyle = ((dwStyle & ~WS_THICKFRAME & ~WS_CAPTION)
		 | ((NUMBERP (border_width) && (XINT (border_width) > 0))
		    ? WS_BORDER : false));
      SetWindowLong (hwnd, GWL_STYLE, dwStyle);
      SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0,
		    SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE
		    | SWP_FRAMECHANGED);
      FRAME_UNDECORATED (f) = true;
    }
  else if (NILP (new_value) && FRAME_UNDECORATED (f))
    {
      SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_THICKFRAME | WS_CAPTION
		     | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU);
      SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0,
		    SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE
		    | SWP_FRAMECHANGED);
      FRAME_UNDECORATED (f) = false;
    }
  unblock_input ();
}

where FRAME_UNDECORATED (f) returns false if f is currently decorated.
If the `border-width' parameter is 0 the frame gets no border, otherwise
it gets the standard Windows thin-line border.

> Care has to be taken to note that when removing caption bar and borders
> it will be no longer possible to move and resize window unless user
> have other means of performing those applications.

You can use the `left', `top', `width' and `height' frame parameters for
that.

martin




This bug report was last modified 7 years and 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.