From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#19075: `toggle-frame-maximized' and `toggle-frame-fullscreen' on Windows Date: Fri, 13 Feb 2015 19:25:35 +0100 Message-ID: <54DE419F.60806@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1423852000 31239 80.91.229.3 (13 Feb 2015 18:26:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Feb 2015 18:26:40 +0000 (UTC) To: Alexander Shukaev , 19075@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 13 19:26:29 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 1YMKwe-00059h-Kf for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Feb 2015 19:26:28 +0100 Original-Received: from localhost ([::1]:57040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMKwd-0003dd-Fm for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Feb 2015 13:26:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMKwJ-00039v-D9 for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 13:26:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMKwE-0005Ix-83 for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 13:26:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMKwE-0005Ir-4x for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 13:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YMKwD-00007x-Sb for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 13:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Feb 2015 18:26:01 +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.1423851952473 (code B ref 19075); Fri, 13 Feb 2015 18:26:01 +0000 Original-Received: (at 19075) by debbugs.gnu.org; 13 Feb 2015 18:25:52 +0000 Original-Received: from localhost ([127.0.0.1]:42135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMKw3-00007Z-DX for submit@debbugs.gnu.org; Fri, 13 Feb 2015 13:25:51 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:59781) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMKw2-00007L-23 for 19075@debbugs.gnu.org; Fri, 13 Feb 2015 13:25:50 -0500 Original-Received: from [88.117.117.6] ([88.117.117.6]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M0hT0-1XRm2I0b0w-00us9N; Fri, 13 Feb 2015 19:25:44 +0100 In-Reply-To: X-Provags-ID: V03:K0:rMVltM9knBjf/FCtNK4+ihlesdL4poUUwIARzTCP0vmKCzUFiOF 8RcXrPazFthlWkGry/NDZcnHyZUgTjbiYHqmbZJH4aFoQ6+YPQMgBGrEO8kXNpCV04FBz76 AUdgZ8poNxgtE4tdCRiuiHmqmZqOYtZQYemn4M/WKhXTIe/XyfWOXZcEvlWVZOlhPXtPHSW e1/+qRrUwne4ZwX3R26dg== X-UI-Out-Filterresults: notjunk:1; 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:99309 Archived-At: > `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