emacs-devel
[Top][All Lists]
Advanced

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

Re: Creating a "borderless" frame (without WM chrome) (was Re: Could x-s


From: martin rudalics
Subject: Re: Creating a "borderless" frame (without WM chrome) (was Re: Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp?)
Date: Wed, 17 Feb 2016 10:13:17 +0100

> * add a frame parameter to frame_parms in frame.c, say "chromeless"

I'd prefer "decorated" as in gtk_window_set-decorated.

> * add an x_set_chromeless slot in each of frame_parm_handler 
x_frame_parm_handlers[], frame_parm_handler w32_frame_parm_handlers[], 
frame_parm_handler ns_frame_parm_handlers[]; for the last two point to 0 for now; 
for the first one point to a new function x_set_chromeless.
> * In x-create-frame, add something like
>      x_default_parameter (f, parms, Qchromeless, Qnil,
>                           "chromeless", "Chromeless", RES_TYPE_BOOLEAN);

For X I doubt that it's always possible to add/remove the decorations of
an existing frame.  For Windows the below works here with

x_default_parameter (f, parameters, Qdecorated, Qnil,
                     "decorated", "Decorated", RES_TYPE_SYMBOL);

martin


void
x_set_decorated (struct frame *f, Lisp_Object decorated, Lisp_Object 
old_decorated)
{
  HWND hwnd = FRAME_W32_WINDOW (f);
  DWORD dwStyle = GetWindowLong (hwnd, GWL_STYLE);

  block_input ();
  if (EQ (decorated, Qnone))
    /* Remove caption and border.  */
    SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_CAPTION & ~WS_THICKFRAME);
  else if (EQ (decorated, Qtip_frame))
    /* Retain 1-pixel wide border.  */
    SetWindowLong (hwnd, GWL_STYLE, (dwStyle & ~WS_CAPTION & ~WS_THICKFRAME) | 
WS_POPUPWINDOW);
  else
    /* Restore decoration.  */
    SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_CAPTION | WS_THICKFRAME);

  /* Preserve outer position and size as well as Z-order.  */
  SetWindowPos (hwnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE
                | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
  unblock_input ();
}



reply via email to

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