|
From: | Arthur Miller |
Subject: | bug#25408: Remove Decorations Around Emacs Frame (Windows OS) |
Date: | Wed, 11 Jan 2017 08:50:16 +0100 |
PostMessage(hwnd, WM_SIZE,0,0);There is a slightly cosmetic issue with above function. When one switches back on decorations,the frame will not resize properly and minibuffer will be not visible. It's there but just
covered by frame. Just resizing emacs framefixes it.
Adding call to PostMessage(hwnd, WM_SIZE,0,0) in Martins function fixes it.
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));*/
/*Lisp_Object undecorated = Fcdr (Fassq (Qundecorated, f->param_alist));*/
block_input ();
if (!NILP (new_value) && !FRAME_UNDECORATED (f))
{
dwStyle = (dwStyle & ~WS_THICKFRAME & ~WS_CAPTION);
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 ();
}2017-01-11 8:24 GMT+01:00 Arthur Miller <arthur.miller.no1@gmail.com>:exercise to learn a bit of emacs internals and to make a simple hack.(check for !NILP) so I can switch back decorations. It works. Thanks all, it was greatI appologize, I was too fast to answer, I made a bad call from modify-frame-parametersthe else-if statement in Martins method to else if (!NILP (new_value) && FRAME_UNDECORATED (f))
when I tested it. It works like a charm as you say it in english. I have also changed2017-01-11 8:08 GMT+01:00 Arthur Miller <arthur.miller.no1@gmail.com>:place where symbol is declared in frame_parms (last in the list), added anadded connecction to w32_frame_parm_handlers[] to x_set_undecorated at sameadded an entry to frame_parms: {"undecorated", SYMBOL_INDEX (Qundecorated)},a boolean_bf undecorated :1, to frame struct, initiated it to false in "make_frame"method to my w32fns.c, added FRAME_DECORATED() macro to frame.hI do run Arch Linux otherwise, but I do some consulting with programming"We call it "Losedows" or "Lose OS", because if you use it, you loseHaha :-) Indeed.
your freedom.
We're glad if Emacs gives you a taste of freedom, but a taste is
all it can give you. To escape from Microsoft's power, you need to
stop using Losedows."
databases and GUIs in access & spss and I also play some games
occasionally, so I still need losedows. I know I could run it in wine andpass through vga, but I feel a bit too old for that :).This was a great excursion in Emacs src code. I added above mention
INLINE void fset_undecorated( ... ) to frame.h (not sure if it is needed), and now
I can change my new param with lisp from emacs, but my connection seemnever to be called.By the way, I think world is better without borders, so I have modified Martin'sx_set_undecorated to
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));*/
/*Lisp_Object undecorated = Fcdr (Fassq (Qundecorated, f->param_alist));*/
block_input ();
if (!NILP (new_value) && !FRAME_UNDECORATED (f))
{
dwStyle = (dwStyle & ~WS_THICKFRAME & ~WS_CAPTION);
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 ();
}So it should just switch on "undecorated" param and ignore borders (at least I hope). I am not sure where doI have to make change more to get it to work.
2017-01-10 21:39 GMT+01:00 Clément Pit--Claudel <clement.pit@gmail.com>:On 2017-01-10 13:27, Eli Zaretskii wrote:
> Then I suggest to add this to Emacs. That some wm's ignore it is not
> a reason to avoid having the feature for those that don't ignore it.
Indeed, it would be wonderful!
[Prev in Thread] | Current Thread | [Next in Thread] |