all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alexander Shukaev <haroogan@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 19075@debbugs.gnu.org
Subject: bug#19075: `toggle-frame-maximized' and `toggle-frame-fullscreen' on Windows
Date: Sat, 27 Jun 2015 17:24:28 +0200	[thread overview]
Message-ID: <CAKu-7WyZpB8b-1G9JVk08oPzaNRSxQhoUAyxpXCRVO+9dLiiLw@mail.gmail.com> (raw)
In-Reply-To: <54DE419F.60806@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 2652 bytes --]

On Fri, Feb 13, 2015 at 8:25 PM, martin rudalics <rudalics@gmx.at> wrote:

> `init.el':
>>
>> (add-hook 'window-setup-hook 'toggle-frame-maximized t)
>> (add-hook 'window-setup-hook 'toggle-frame-fullscreen t)
>>
>
> Actually, this could never have worked.  Emacs internally sets up a list
> of parameters to be used for the initial frame and the second form just
> annihilates any effect of the first.
>
>  does not work as expected. Emacs goes fullscreen indeed. However, running
>> manually `(toggle-frame-fullscreen)' once again after Emacs loaded, does
>> not bring Emacs into maximized state, it rather returns to a small initial
>> frame (of the default size, `emacs -q' to remind yourself how it looks
>> like).
>>
>
> In fact.  Emacs never went to the maximized state so it can't return to
> it.
>
>  Changing `init.el' to:
>>
>> (add-to-list 'default-frame-alist '(fullscreen . maximized))
>> (add-hook 'window-setup-hook 'toggle-frame-fullscreen t)
>>
>> does not help either.
>>
>
> The effect is the same as above.
>
>  One could think that somehow `maximized' parameter is not set, but if one
>> has in `init.el' only:
>>
>> (add-to-list 'default-frame-alist '(fullscreen . maximized))
>>
>> or
>>
>> (add-hook 'window-setup-hook 'toggle-frame-maximized t)
>>
>> then Emacs is loaded into maximized state indeed (*).
>>
>
> Because there's no fullscreen request that overrides it.
>
>  On the other hand in `emacs -q', if one runs
>>
>> (toggle-frame-maximized)
>> (toggle-frame-fullscreen)
>>
>> manually, and then runs `(toggle-frame-fullscreen)' manually once again,
>> then Emacs is brought to maximized state.
>>
>
> Indeed.  These are two commands processed separately.
>
>  All this makes me think that there is some problem with memorizing
>> `maximized' parameter during `window-setup-hook', but note that this
>> actually contradicts (*) what makes this problem even more confusing.
>>
>
> I've now implemented a couple of changes on trunk which allow to
> memorize that parameter, which I renamed to `fullscreen-restore'.  In
> particular, using an equivalent of the following form in your init file
> should accomplish what you want.
>
> (setq initial-frame-alist
>       '((fullscreen . fullboth) (fullscreen-restore . maximized)))
>
> Using `toggle-frame-fullscreen' and `toggle-frame-fullscreen' in the
> initial file is confusing.  These specify transitions rather than states
> and an initial file should rather specify the desired initial state of a
> frame.
>
> martin
>

​Amazing.  Thanks, Martin!  This one can be definitely closed.​

[-- Attachment #2: Type: text/html, Size: 4355 bytes --]

  reply	other threads:[~2015-06-27 15:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  8:13 bug#19075: `toggle-frame-maximized' and `toggle-frame-fullscreen' on Windows Alexander Shukaev
2014-11-17  9:29 ` martin rudalics
2014-11-17  9:48   ` Alexander Shukaev
2014-11-17 10:16     ` martin rudalics
2014-11-17 16:03       ` Eli Zaretskii
2015-02-13 18:25 ` martin rudalics
2015-06-27 15:24   ` Alexander Shukaev [this message]
2015-06-29  9:45     ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKu-7WyZpB8b-1G9JVk08oPzaNRSxQhoUAyxpXCRVO+9dLiiLw@mail.gmail.com \
    --to=haroogan@gmail.com \
    --cc=19075@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.