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: "arthur.miller.no1" <arthur.miller.no1 <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 25408 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, Clément Pit--Claudel <clement.pit <at> gmail.com>
Subject: bug#25408: SV: Re: bug#25408: Remove Decorations Around Emacs Frame (Windows OS)
Date: Wed, 11 Jan 2017 15:59:59 +0100
[Message part 1 (text/plain, inline)]
    
Aha thanks for clarifications. I didn't dive enough into src so I missed those other funcrions called before a frame is made.
I had from beginnig nil and t as values for my decor var, but I realized I could use 1 and 0 too so I did :). It works fine to switch it off/on manually.
I am away from home untill friday so it will have to wait before I can play more with emacs. Also if you going to merge your code into master on git soon, then I will probably abandon my changes and use yours :).
Skickat från min Samsung-enhet

-------- Originalmeddelande --------
Från: martin rudalics <rudalics <at> gmx.at> 
Datum: 2017-01-11  14:55  (GMT+01:00) 
Till: Arthur Miller <arthur.miller.no1 <at> gmail.com> 
Kopia: Clément Pit--Claudel <clement.pit <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 25408 <at> debbugs.gnu.org 
Rubrik: Re: bug#25408: Remove Decorations Around Emacs Frame (Windows OS) 

 > (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

[Message part 2 (text/html, inline)]

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

Previous Next


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