From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#25818: 25.2; frame moved off display does not return (OS X) Date: Tue, 28 Feb 2017 14:20:55 +0100 Message-ID: References: <58AEA232.4000708@gmx.at> <58B30634.1090904@gmx.at> <58B3DDBA.6060003@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=f403045e6976f1dabd054997102b X-Trace: blaine.gmane.org 1488292381 17479 195.159.176.226 (28 Feb 2017 14:33:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Feb 2017 14:33:01 +0000 (UTC) Cc: 25818@debbugs.gnu.org To: "Charles A. Roelli" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 28 15:32:55 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciipg-0003h0-Hs for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Feb 2017 15:32:52 +0100 Original-Received: from localhost ([::1]:33327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciipm-0008DQ-Gn for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Feb 2017 09:32:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cihjC-0003qj-Br for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 08:22:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cihj8-0004ff-AM for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 08:22:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60992) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cihj8-0004fa-4b for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 08:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cihj7-0006e7-Ui for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 08:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2017 13:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25818 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25818-submit@debbugs.gnu.org id=B25818.148828806425480 (code B ref 25818); Tue, 28 Feb 2017 13:22:01 +0000 Original-Received: (at 25818) by debbugs.gnu.org; 28 Feb 2017 13:21:04 +0000 Original-Received: from localhost ([127.0.0.1]:59191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cihiC-0006ct-5r for submit@debbugs.gnu.org; Tue, 28 Feb 2017 08:21:04 -0500 Original-Received: from mail-ua0-f178.google.com ([209.85.217.178]:35984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cihiA-0006bb-FK for 25818@debbugs.gnu.org; Tue, 28 Feb 2017 08:21:03 -0500 Original-Received: by mail-ua0-f178.google.com with SMTP id 72so12648143uaf.3 for <25818@debbugs.gnu.org>; Tue, 28 Feb 2017 05:21:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mzZjpweb0BTAwf0uiKfqxpHYNHZPvKlBE4pNmXVkojg=; b=DTuUNMXNG1rXek6Mp7P4UT/OgxbuUr9JB4VbclwMIQSzeEeiAHx6UVzDpBBdENqGBB CpWQVF8iihf5CfqZR+WG3Fz6rmdZegMVd161V2OOqfN3Z5IfrZ5Z1Qb4cAHjo1nEdLR7 wFxd2NSQCM60dV8nLLctfUsydguoTVpgYpL6cOcrSpqIdnkVQBirJPdmwcu1ciSr9Vim Y83DryhFW+A/ZhGhIZg9xdkzsz+LUZ2HRRtj95j9onMlZuAZgMgZsAoVx9ua0/AJzNkw l/zd2zXmgKobOs9IXpy1k22AA35WUNF3dVDdoe21m6lsEDC5RABh+40nm29VlTWIt90D wQuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mzZjpweb0BTAwf0uiKfqxpHYNHZPvKlBE4pNmXVkojg=; b=ttod0vw0GykCtVqqtFK127mj26uljCaouvww6HuZjK1MZJFnZzq/3j59XpzTqgD36s +DIdAYtAxFlAfIdLd9zl9jBcZxTHGwcKVZdhsSIjxAZD1cOVKNga1KHdNUFEVbZQyP+j gmu4grmQBiBf7TAfm2uRuNbCBfhSHA7tVREhwqoi0/fJyFhd8SpnESVY+MHU1hyflDk4 am2fX0c9eG+CXvuX39q3nTagiW9yRix8FH+dac4e/MkU6KV7cg8TKqA9wXKfjVf7A6Py WoYh2HKaZ10GCwOIxapydcz1hLARWjmbq95RYvxRhr164bfrKqIWTAUf22vu3nH13A8S RdqQ== X-Gm-Message-State: AMke39mLxBXyELcL7svheTeurqhKlMIBHtH/NJYwXhBiAKOMDJaqyau4m0U31jXcQ6i3P3uaO7MlAXfODLHK9Q== X-Received: by 10.176.75.1 with SMTP id h1mr853010uaf.145.1488288056693; Tue, 28 Feb 2017 05:20:56 -0800 (PST) Original-Received: by 10.31.242.15 with HTTP; Tue, 28 Feb 2017 05:20:55 -0800 (PST) In-Reply-To: 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: 208.118.235.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:129941 Archived-At: --f403045e6976f1dabd054997102b Content-Type: multipart/alternative; boundary=f403045e6976f1dab60549971029 --f403045e6976f1dab60549971029 Content-Type: text/plain; charset=UTF-8 Hi! I'm the author behind the changes you are discussing. Emacs 24.3 demonstrates a number of problems when you want to stretch Emacs across two screens and also when placing the title bar above the top of the screen (which is very useful when `ns-auto-hide-menu-bar' is non-nil). Applying the suggested patch would only reintroduce those problems. A better solution would be to add to code to check if the Emacs frame is outside any monitor, and then (and only then) call the constrainFrameRect method of the parent class. Also, if I remember correctly, 24.3 behaved differently when you had one monitor compared to multiple monitors. I removed this, as I didn't see the point of it, and because if introduced an extra level of complexity when it came to testing. When it comes to `display-pixel-width', it should return the combined width of side-by-side monitors, so 24.4 and newer Emacs versions behave correctly. I have attached a test file I used when I worked with the NS port. Anyway, I'm glad that you have looked into this. The number of people actively working on the NS port are close to zero (I threw in the towel about a year ago, simply because I couldn't find the time I needed to spend on it). If you are interested in contributing, you can look at the "NeXTstep port" section of the "TODO" file. -- Anders On Mon, Feb 27, 2017 at 9:47 PM, Charles A. Roelli wrote: > Bisecting between emacs-24.3 and emacs-24.4 led me to commit > 680e6b8c5a28489733df544edb074fd29d0522a0, which introduces the > regression. There is also a possibly related commit two hours later, > 1269a680862a9bc6cd65e3d26ef05f68c7521632. > > Commit 680e6b8c introduces the behavior observed in 24.4, where a frame > is not constrained to the screen area. Also interesting is that > `display-pixel-width' works correctly (for multiple monitors as well, > that is) in the commit and the commits immediately preceding it, so it > may only be tangentially related. > > I'm attaching the changeset of 680e6b8c and CCing the author. > > I looked into constrainFrameRect, and it seems to have different > behavior depending on whether "Spaces" are available (introduced in OS X > 10.9 apparently). Might also have something to with the issue at hand. > > --f403045e6976f1dab60549971029 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!

I'm the author behind the chang= es you are discussing.

Emacs 24.3 demonstrates a n= umber of problems when you want to stretch Emacs across two screens and als= o when placing the title bar above the top of the screen (which is very use= ful when `ns-auto-hide-menu-bar' is non-nil). Applying the suggested pa= tch would only reintroduce those problems.

A bette= r solution would be to add to code to check if the Emacs frame is outside a= ny monitor, and then (and only then) call the constrainFrameRect method of = the parent class.

Also, if I remember correctl= y, 24.3 behaved differently when you had one monitor compared to multiple m= onitors. I removed this, as I didn't see the point of it, and because i= f introduced an extra level of complexity when it came to testing.

When it comes to `display-pixel-width', it should retu= rn the combined width of side-by-side monitors, so 24.4 and newer Emacs ver= sions behave correctly.

I have attached a test fil= e I used when I worked with the NS port.

Anyway, I= 'm glad that you have looked into this. The number of people actively w= orking on the NS port are close to zero (I threw in the towel about a year = ago, simply because I couldn't find the time I needed to spend on it). = If you are interested in contributing, you can look at the "NeXTstep p= ort" section of the "TODO" file.

= =C2=A0 =C2=A0 -- Anders


On Mon, Feb 27, 2017 at 9:47 PM, Charles A= . Roelli <charles@aurox.ch> wrote:
Bisecting between emacs-24.3 and emacs-24.4 led me to commit
680e6b8c5a28489733df544edb074fd29d0522a0, which introduces the
regression.=C2=A0 There is also a possibly related commit two hours later,<= br> 1269a680862a9bc6cd65e3d26ef05f68c7521632.

Commit 680e6b8c introduces the behavior observed in 24.4, where a frame
is not constrained to the screen area.=C2=A0 Also interesting is that
`display-pixel-width' works correctly (for multiple monitors as well, that is) in the commit and the commits immediately preceding it, so it
may only be tangentially related.

I'm attaching the changeset of 680e6b8c and CCing the author.

I looked into constrainFrameRect, and it seems to have different
behavior depending on whether "Spaces" are available (introduced = in OS X
10.9 apparently).=C2=A0 Might also have something to with the issue at hand= .


--f403045e6976f1dab60549971029-- --f403045e6976f1dabd054997102b Content-Type: application/octet-stream; name="ns-frame-test.el" Content-Disposition: attachment; filename="ns-frame-test.el" Content-Transfer-Encoding: base64 X-Attachment-Id: f_izpk3ske1 OzsgbnMtZnJhbWUtdGVzdC5lbCAtLS0gdGVzdCBmb3IgTmV4dFN0ZXAgKE1hYyBPUyBYKSBmcmFt ZSBwb3NpdGlvbmluZy4KCjs7IEF1dGhvcjogQW5kZXJzIExpbmRncmVuCgo7OyBUaGlzIGZpbGUg aXMgKm5vdCogaW50ZW5kZWQgdG8gYmUgbG9hZGVkIGludG8gRW1hY3MuIEluc3RlYWQsIGl0Cjs7 IGNvbnRhaW5zIGluZGl2aWR1YWwgZXhwcmVzc2lvbnMgdGhhdCBzaG91bGQgYmUgZXZhbHVhdGVk IG9uZSBieQo7OyBvbmUsIHdpdGggYWNjb21wYW55aW5nIG1hbnVhbCB0ZXN0IHN0ZXBzLgoKOzsg RnV0dXJlIGRldmVsb3BtZW50Ogo7Owo7OyAqIEFkZCBtb3JlIHRlc3QgY2FzZXMsIGxpa2UgcmVz b2x1dGlvbiBjaGFuZ2UsIGZyYW1lIHN0cmV0Y2hpbmcKOzsgICBtdWx0aXBsZSBzY3JlZW5zLCBh bmQgZHJhZ2dpbmcgYmV0d2VlbiBkaWZmZXJlbnQgc2l6ZWQgc2NyZWVucy4KOzsKOzsgKiBBdXRv bWF0aWMgdGVzdGluZyB1c2luZyBhIHVuaXQgdGVzdCBmcmFtZXdvcmssIGZvciBleGFtcGxlIGVy dC4KOzsKKGVycm9yICJZb3Ugc2hvdWxkIG5vdCBsb2FkIHRoaXMgZmlsZSwgcmVhZCB0aGUgZmls ZSBjb21tZW50cyBmb3IgZGV0YWlscyIpCgo7OyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tCjs7IEJhc2ljcwo7OwoKOzsgSW5pdGlhbGx5LCBFbWFjcyBzaG91bGQgYmUg cGxhY2VkIHVuZGVyIHRoZSBtZW51IGJhci4KCjs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