From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Spenser Truex Newsgroups: gmane.emacs.bugs Subject: bug#31920: 26.1; frame appears in wrong part of desktop after restoring frameset from fullscreen Date: Sun, 30 Jun 2019 23:08:40 -0700 Message-ID: <87imsm1e3b.fsf@spensertruex.com> References: <5B2B50C8.2090600@gmx.at> <87zhzo3083.fsf@gmail.com> <5B2CB996.4060606@gmx.at> <877emr2hmf.fsf@gmail.com> <5B2CE8F0.8070702@gmx.at> <87zhzn0w1y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="207335"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 31920@debbugs.gnu.org, Jonathan Kyle Mitchell To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 01 16:49:56 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhxcx-000rnQ-4v for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jul 2019 16:49:55 +0200 Original-Received: from localhost ([::1]:59592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhxcv-0002Nw-Rl for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Jul 2019 10:49:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56308) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhxNe-0003kH-00 for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:34:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhxNc-0002SY-KQ for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:34:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35306) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hhxNa-0002Qy-9d for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hhxNa-0006GW-0c for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2019 10:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spenser Truex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jul 2019 14:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31920 X-GNU-PR-Package: emacs Original-Received: via spool by 31920-submit@debbugs.gnu.org id=B31920.156199161924047 (code B ref 31920); Mon, 01 Jul 2019 14:34:01 +0000 Original-Received: (at 31920) by debbugs.gnu.org; 1 Jul 2019 14:33:39 +0000 Original-Received: from localhost ([127.0.0.1]:48850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhxNC-0006Fm-1h for submit@debbugs.gnu.org; Mon, 01 Jul 2019 10:33:39 -0400 Original-Received: from spensertruex.com ([66.70.189.182]:57144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhpTf-000083-DP for 31920@debbugs.gnu.org; Mon, 01 Jul 2019 02:07:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spensertruex.com; s=myselector; t=1561961261; bh=zv9n7PpmyRMixWI4YsAqRlQ/kRIUDV7UmqRX4vbqDu0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=PKxV2yuxOC99XjJozPjIDRmBMe+ZENkqdH3hIJcr2Ugov+ncAk/kfgmyJ2K9IQqvZ uBFOydUQFvHGkEFKqGShq9nTRUFUv7+uGPZcR1iZFbwgbOJGGy9WC4mH3zW2QQqyMY +CZI+qzKTk3Ua80X3eDw7HODUJMcBcNgCWunowyLv7uP+hhF+VTuGhF7B/DvLRqVjn vyXZLnAmOCr0dm15wA71Wu04YoCzs8EYgFZ/zhBo/aDzvAKH/kFHT4HUH6/+Imj0RM LuQEN1tOaF0hA9o/yoCvyN1JxFgNifDEqKUdKjdLl4yPe0aXQuxWeV61vV51CVG1Vc 2xYadcULocCCw== In-Reply-To: <87zhzn0w1y.fsf@gmail.com> (Robert Pluim's message of "Fri, 22 Jun 2018 15:50:49 +0200") X-Mailman-Approved-At: Mon, 01 Jul 2019 10:33:34 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:161937 Archived-At: Robert Pluim writes: > diff --git i/lisp/frame.el w/lisp/frame.el > index 29c31f41cb..a58fad6481 100644 > --- i/lisp/frame.el > +++ w/lisp/frame.el > @@ -2413,7 +2413,7 @@ toggle-frame-maximized > (t > (set-frame-parameter nil 'fullscreen 'maximized))))) > > -(defun toggle-frame-fullscreen () > +(defun toggle-frame-fullscreen (&optional frame) > "Toggle fullscreen state of selected frame. > Make selected frame fullscreen or restore its previous size if it > is already fullscreen. > @@ -2431,14 +2431,14 @@ toggle-frame-fullscreen > > See also `toggle-frame-maximized'." > (interactive) > - (let ((fullscreen (frame-parameter nil 'fullscreen))) > + (let ((fullscreen (frame-parameter frame 'fullscreen))) > (if (memq fullscreen '(fullscreen fullboth)) > - (let ((fullscreen-restore (frame-parameter nil 'fullscreen-restore))) > + (let ((fullscreen-restore (frame-parameter frame 'fullscreen-restore))) > (if (memq fullscreen-restore '(maximized fullheight fullwidth)) > - (set-frame-parameter nil 'fullscreen fullscreen-restore) > - (set-frame-parameter nil 'fullscreen nil))) > + (set-frame-parameter frame 'fullscreen fullscreen-restore) > + (set-frame-parameter frame 'fullscreen nil))) > (modify-frame-parameters > - nil `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))) > + frame `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))) > ;; Manipulating a frame without waiting for the fullscreen > ;; animation to complete can cause a crash, or other unexpected > ;; behavior, on macOS (bug#28496). > diff --git i/lisp/frameset.el w/lisp/frameset.el > index 0e3363d7ae..ffbf6722a7 100644 > --- i/lisp/frameset.el > +++ w/lisp/frameset.el > @@ -1085,6 +1085,11 @@ frameset--restore-frame > (when (frame-live-p parent-frame) > (set-frame-parameter frame 'parent-frame parent-frame))) > > + (let ((old-fullscreen (frame-parameter frame 'fullscreen))) > + (and (not (eq old-fullscreen fullscreen)) > + (memq old-fullscreen '(fullscreen fullboth)) > + (not fullscreen) > + (toggle-frame-fullscreen frame))) > (modify-frame-parameters frame > (if (eq (frame-parameter frame 'fullscreen) fullscreen) > ;; Workaround for bug#14949 > > > > I've just discovered this bug for myself, without any register manipulation. Here is the recipe (almost the same as the original): 1) Make a window and use the WM to make it 1/2 the screen size. I usually grab the window with the mouse and hit it against the right side of the screen. 2) F11 to toggle fullscreen. 3) do #2 again. Now the window isn't perfectly 1/2 the window. Checking the value of (frame-parameter nil 'fullscreen) produces the symbol fullheight, which indicates the problem: the emacs restore procedure (fullscreen-restore) only stores *some* information about the previous window configuration. The following diff shows the workaround I was using so I could happily use f11 with my emacs: --- lisp/frame.el 2019-06-30 21:42:29.257939995 -0700 +++ lisp/frame.el 2019-06-30 21:41:34.239940756 -0700 @@ -2621,21 +2621,21 @@ `frame-resize-pixelwise' to non-nil in order to make a frame appear truly fullscreen. In addition, you may have to set `x-frame-normalize-before-maximize' in order to enable transitions from one fullscreen state to another. See also `toggle-frame-maximized'." (interactive) (let ((fullscreen (frame-parameter frame 'fullscreen))) (if (memq fullscreen '(fullscreen fullboth)) (let ((fullscreen-restore (frame-parameter frame 'fullscreen-restore))) - (if (memq fullscreen-restore '(maximized fullheight fullwidth)) + (if (memq fullscreen-restore '(maximized)) (set-frame-parameter frame 'fullscreen fullscreen-restore) (set-frame-parameter frame 'fullscreen nil))) (modify-frame-parameters frame `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen)))) ;; Manipulating a frame without waiting for the fullscreen ;; animation to complete can cause a crash, or other unexpected ;; behavior, on macOS (bug#28496). (when (featurep 'cocoa) (sleep-for 0.5)))) So I just threw out all width and height information. To do a proper fix, I think Emacs needs to keep track of sufficient information about the window. Window height, width, and location must be stored. The current one only stores height or width. This way the window manager seems to be able to make all the decisions about window size, though I actually have no idea what is going on. For toggle-frame-maximized the problem still exists though, and I have not found any workaround. -- Spenser Truex