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

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

bug#25408: Remove Decorations Around Emacs Frame (Windows OS)


From: martin rudalics
Subject: bug#25408: Remove Decorations Around Emacs Frame (Windows OS)
Date: Wed, 11 Jan 2017 14:55:27 +0100

> (add-to-list 'default-frame-alist '(undecorated . 0))
> (setq default-frame-alist '((undecorated . 0)))
> (setq initial-frame-alist '((undecorated . 0)))
>
> But that does not give any effect at all.

"0" is a quite misleading value ;-) See below.

But I think I understand what happens.  In fact, I haven't told you the
whole story: In Fx_create_frame I do additionally

  tem = x_get_arg (dpyinfo, parameters, Qundecorated, NULL, NULL,
                       RES_TYPE_BOOLEAN);
  FRAME_UNDECORATED (f) = !NILP (tem) && !EQ (tem, Qunbound);
  store_frame_param (f, Qundecorated, FRAME_UNDECORATED (f) ? Qt : Qnil);

somewhere _before_ w32_window (f, window_prompting, minibuffer_only)
gets called.  And in w32_createwindow I have

  else if (FRAME_UNDECORATED (f))
    {
      f->output_data.w32->dwStyle = ~WS_THICKFRAME & ~WS_CAPTION;

      /* If we want a thin border, specify it here.  */
      if (NUMBERP (border_width) && (XINT (border_width) > 0))
        f->output_data.w32->dwStyle =
          f->output_data.w32->dwStyle | WS_BORDER;
    }

before any other f->output_data.w32->dwStyle assignment and certainly
before the

  FRAME_W32_WINDOW (f) = hwnd
    = CreateWindow (EMACS_CLASS,
                    f->namebuf,
                    f->output_data.w32->dwStyle,
                    ...

call.  Just make sure that any time you set f->output_data.w32->dwStyle
you don't overrule a previous assignment.  (I haven't sent you a patch
because I have completely redesigned the assignments to this component
and it probably would distract more than provide any help.)  This way

(add-to-list 'default-frame-alist '(undecorated . t))
(setq default-frame-alist '((undecorated . t)))
(setq initial-frame-alist '((undecorated . t)))

should all work.

BTW, you can also do

      f->output_data.w32->dwStyle = WS_POPUP;

because the only thing Windows forbids in this context is to set
WS_POPUP for an existing overlapped window (IIRC).

> (defvar decor 0)
> (defun toggle-frame-decor ()
>    (interactive)
>    (progn
>     (modify-frame-parameters (selected-frame) `((undecorated . ,'decor)))

You likely mean

     (modify-frame-parameters (selected-frame) `((undecorated . ,decor)))

here.  And probably you want to do the following calculation

>     (if (= decor 0)
>         (setq decor 1)
>       (setq decor 0))))

before calling ‘modify-frame-parameters’ so the latter will see the new
value.  But even this won't work because you want to toggle beween nil
and non-nil so

(devfar decor nil)

and

(setq decor (not decor))

are more appropriate.

martin






reply via email to

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