From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.bugs Subject: bug#19075: `toggle-frame-maximized' and `toggle-frame-fullscreen' on Windows Date: Sat, 27 Jun 2015 17:24:28 +0200 Message-ID: References: <54DE419F.60806@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133c258da314f05198173b2 X-Trace: ger.gmane.org 1435418722 19102 80.91.229.3 (27 Jun 2015 15:25:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Jun 2015 15:25:22 +0000 (UTC) Cc: 19075@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 27 17:25:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z8ryh-0005yq-Fi for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 17:25:11 +0200 Original-Received: from localhost ([::1]:35908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8ryg-0005gk-M4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 11:25:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8ryc-0005di-DL for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 11:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8ryZ-0003CR-6j for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 11:25:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8ryZ-0003CB-2j for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 11:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z8ryY-0007OF-M4 for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 11:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alexander Shukaev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jun 2015 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19075 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19075-submit@debbugs.gnu.org id=B19075.143541867928374 (code B ref 19075); Sat, 27 Jun 2015 15:25:02 +0000 Original-Received: (at 19075) by debbugs.gnu.org; 27 Jun 2015 15:24:39 +0000 Original-Received: from localhost ([127.0.0.1]:59296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8ryA-0007NY-8W for submit@debbugs.gnu.org; Sat, 27 Jun 2015 11:24:39 -0400 Original-Received: from mail-la0-f45.google.com ([209.85.215.45]:33698) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8ry6-0007NJ-OL for 19075@debbugs.gnu.org; Sat, 27 Jun 2015 11:24:35 -0400 Original-Received: by laar3 with SMTP id r3so22564337laa.0 for <19075@debbugs.gnu.org>; Sat, 27 Jun 2015 08:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pMh7N0iYREAhO3Nbg9x58UngsrtfdnBuk6XFxYGAHig=; b=iG7IE7MHfi9uapXSd+UIZ6FhfhDSjH2G4wnpq3BNtahC49e5X8MM2n3z7Mw4IGFXm5 uowEKLa64AJ5xCkz5DN5LhDNAvud2uYwOd26/ag5eo0aBE5Dh5bIRFaV0oZ5+VFLel5k pqce88u0OO2hGV050vkhqEM/B8NUI/HpZocCw5jnN6gfLN4ytxjnFU39miLWJBuZYe8G jo1NACPuw5MVQOjag7HJ0Vec+n+jqMm9MVumfa88+DHaGq2AvfvRQO8tPCP4JRMP8PDM wEqrpXC6CVhPuj1ZONSgp9CA93NAYdL0Sxg83v8gJhR3nFgRSILKSihYY6H/0Tek0GXI 3jJw== X-Received: by 10.152.164.193 with SMTP id ys1mr6343915lab.65.1435418668706; Sat, 27 Jun 2015 08:24:28 -0700 (PDT) Original-Received: by 10.112.36.103 with HTTP; Sat, 27 Jun 2015 08:24:28 -0700 (PDT) In-Reply-To: <54DE419F.60806@gmx.at> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104406 Archived-At: --001a1133c258da314f05198173b2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Feb 13, 2015 at 8:25 PM, martin rudalics 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, runnin= g >> manually `(toggle-frame-fullscreen)' once again after Emacs loaded, does >> not bring Emacs into maximized state, it rather returns to a small initi= al >> 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 on= e >> 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 > =E2=80=8BAmazing. Thanks, Martin! This one can be definitely closed.=E2= =80=8B --001a1133c258da314f05198173b2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Feb 13, 2015 at 8:2= 5 PM, martin rudalics <rudalic= s@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.=C2=A0 Emacs internally sets up a li= st
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, doe= s
not bring Emacs into maximized state, it rather returns to a small initial<= br> frame (of the default size, `emacs -q' to remind yourself how it looks<= br> like).

In fact.=C2=A0 Emacs never went to the maximized state so it can't retu= rn 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 o= ne
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.=C2=A0 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 thi= s
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'.=C2=A0= In
particular, using an equivalent of the following form in your init file
should accomplish what you want.

(setq initial-frame-alist
=C2=A0 =C2=A0 =C2=A0 '((fullscreen . fullboth) (fullscreen-restore . ma= ximized)))

Using `toggle-frame-fullscreen' and `toggle-frame-fullscreen' in th= e
initial file is confusing.=C2=A0 These specify transitions rather than stat= es
and an initial file should rather specify the desired initial state of a frame.

martin

=E2=80=8BAmazing.= =C2=A0 Thanks, Martin!=C2=A0 This one can be definitely closed.=E2=80=8B
--001a1133c258da314f05198173b2--